diff --git a/plugins/persist-sqlite/base_msgs.c b/plugins/persist-sqlite/base_msgs.c index f6a4b6bc5..895c2c3fc 100644 --- a/plugins/persist-sqlite/base_msgs.c +++ b/plugins/persist-sqlite/base_msgs.c @@ -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);