mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-05-07 01:54:46 +02:00
Fix Coverity Scan 1486953 Use after free
This commit is contained in:
parent
07b7533b1e
commit
b3096982b5
|
|
@ -115,7 +115,10 @@ static char *properties_to_json(const mosquitto_property *properties)
|
|||
case MQTT_PROP_SERVER_REFERENCE:
|
||||
case MQTT_PROP_REASON_STRING:
|
||||
/* str */
|
||||
mosquitto_property_read_string(properties, propid, &value, false);
|
||||
if(mosquitto_property_read_string(properties, propid, &value, false)){
|
||||
cJSON_Delete(array);
|
||||
return NULL;
|
||||
}
|
||||
if(cJSON_AddStringToObject(obj, "value", value) == NULL){
|
||||
free(value);
|
||||
cJSON_Delete(array);
|
||||
|
|
|
|||
Loading…
Reference in a new issue