Set *name to NULL on failure.

pull/1364/head
Roger A. Light 6 years ago
parent 46d12086c9
commit c32715d383

@ -1064,7 +1064,10 @@ const mosquitto_property *mosquitto_property_read_string_pair(const mosquitto_pr
if(value){
*value = calloc(1, p->value.s.len+1);
if(!(*value)){
if(name) free(*name);
if(name){
free(*name);
*name = NULL;
}
return NULL;
}
memcpy(*value, p->value.s.v, p->value.s.len);

Loading…
Cancel
Save