mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-25 11:15:54 +08:00
Fix various Coverity Scan issues.
This commit is contained in:
+4
-1
@@ -100,8 +100,11 @@ SUBS_OBJS = \
|
||||
database.o \
|
||||
memory_mosq.o \
|
||||
memory_public.o \
|
||||
packet_datatypes.o \
|
||||
property_mosq.o \
|
||||
subs.o \
|
||||
topic_tok.o
|
||||
topic_tok.o \
|
||||
utf8_mosq.o \
|
||||
|
||||
all : test
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ static void TEST_100k_random_clients(void)
|
||||
db.now_s = 1000;
|
||||
db.config = calloc(1, sizeof(struct mosquitto__config));
|
||||
if(db.config == NULL){
|
||||
free(contexts);
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_PTR_NOT_NULL(db.config);
|
||||
@@ -194,6 +195,8 @@ static void TEST_100k_random_clients(void)
|
||||
rc = keepalive__init();
|
||||
CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS);
|
||||
if(rc != MOSQ_ERR_SUCCESS){
|
||||
free(contexts);
|
||||
free(db.config);
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_EQUAL(keepalive_list_max, 98303);
|
||||
|
||||
@@ -514,6 +514,8 @@ static void missing_read_helper(mosquitto_property *proplist)
|
||||
|
||||
/* MISSING */
|
||||
prop = mosquitto_property_read_string_pair(proplist, MQTT_PROP_USER_PROPERTY, &key, &value, false);
|
||||
free(key);
|
||||
free(value);
|
||||
CU_ASSERT_PTR_NULL(prop);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,15 +100,6 @@ uint16_t mosquitto__mid_generate(struct mosquitto *mosq)
|
||||
return ++mid;
|
||||
}
|
||||
|
||||
int mosquitto_property_add_varint(mosquitto_property **proplist, int identifier, uint32_t value)
|
||||
{
|
||||
UNUSED(proplist);
|
||||
UNUSED(identifier);
|
||||
UNUSED(value);
|
||||
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
int persist__backup(bool shutdown)
|
||||
{
|
||||
UNUSED(shutdown);
|
||||
@@ -121,11 +112,6 @@ int persist__restore(void)
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
void mosquitto_property_free_all(mosquitto_property **properties)
|
||||
{
|
||||
UNUSED(properties);
|
||||
}
|
||||
|
||||
int retain__init(void)
|
||||
{
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user