Skip to content

Commit 5e52ef4

Browse files
committed
* MDF [mqtt_public] a safety checker for nng_Strdup
Signed-off-by: Jaylin <jaylin@emqx.io>
1 parent 4d25659 commit 5e52ef4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/supplemental/mqtt/mqtt_public.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ nng_mqtt_set_sqlite_conf(nng_mqtt_sqlite_option *opt, void *config,
11261126
const char *bridge_name, uint8_t pro_ver, void *conf_sqlite)
11271127
{
11281128
opt->bridge = config;
1129-
opt->bridge_name = nng_strdup(bridge_name);
1129+
opt->bridge_name = bridge_name ? nng_strdup(bridge_name) : NULL;
11301130
opt->proto_ver = pro_ver;
11311131
opt->sqlite_conf = conf_sqlite;
11321132
}

0 commit comments

Comments
 (0)