From 1771dd99418424822077e5949d04f1cdfaa9637e Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 23 Mar 2022 21:59:12 +0000 Subject: [PATCH] Fix Coverity Scan 1436854 Resource leak --- lib/handle_suback.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/handle_suback.c b/lib/handle_suback.c index 48914096..8367303f 100644 --- a/lib/handle_suback.c +++ b/lib/handle_suback.c @@ -76,18 +76,14 @@ int handle__suback(struct mosquitto *mosq) qos_count = (int)(mosq->in_packet.remaining_length - mosq->in_packet.pos); granted_qos = mosquitto__malloc((size_t)qos_count*sizeof(int)); if(!granted_qos){ -#ifdef WITH_BROKER mosquitto_property_free_all(&properties); -#endif return MOSQ_ERR_NOMEM; } while(mosq->in_packet.pos < mosq->in_packet.remaining_length){ rc = packet__read_byte(&mosq->in_packet, &qos); if(rc){ mosquitto__FREE(granted_qos); -#ifdef WITH_BROKER mosquitto_property_free_all(&properties); -#endif return rc; } granted_qos[i] = (int)qos;