mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-27 22:29:31 +08:00
Guard against use-after-free.
Coverity Scan 1431131, 1431135, 1431141.
This commit is contained in:
@@ -196,6 +196,8 @@ static int json_print_properties(cJSON *root, const mosquitto_property *properti
|
||||
}
|
||||
cJSON_AddItemToObject(user_json, strname, tmp);
|
||||
free(strname);
|
||||
strname = NULL;
|
||||
strvalue = NULL;
|
||||
tmp = NULL; /* Don't add this to prop_json below */
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user