From 1a5cd9e84906ac64a210858883b3977ca1820f03 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 16 Oct 2022 07:39:50 +0100 Subject: [PATCH] Fix Coverity Scan 1499794. --- plugins/persist-sqlite/base_msgs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/persist-sqlite/base_msgs.c b/plugins/persist-sqlite/base_msgs.c index 7bace8c2..d158fcd1 100644 --- a/plugins/persist-sqlite/base_msgs.c +++ b/plugins/persist-sqlite/base_msgs.c @@ -32,7 +32,6 @@ static char *properties_to_json(const mosquitto_property *properties) cJSON *array, *obj; char *json_str, *name, *value; uint8_t i8; - void *binval; uint16_t len; int propid; @@ -86,6 +85,7 @@ static char *properties_to_json(const mosquitto_property *properties) case MQTT_PROP_CORRELATION_DATA: /* bin */ + void *binval = NULL; mosquitto_property_read_binary(properties, propid, &binval, &len, false); char *hexval = malloc(2*(size_t)len + 1); if(!hexval){