Guard against use-after-free.

Coverity Scan 1431131, 1431135, 1431141.
This commit is contained in:
Roger A. Light
2020-08-06 13:36:24 +01:00
parent 84e4ba2c1e
commit 1b060bb064
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -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;
}