From 5c3c5d779fd07d10b7e778dbaeecf30fd30e7a87 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 31 Aug 2022 11:36:53 +0100 Subject: [PATCH] Fix Coverity 1486949 --- lib/handle_pubackcomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/handle_pubackcomp.c b/lib/handle_pubackcomp.c index b2dcf7ee..4568bb40 100644 --- a/lib/handle_pubackcomp.c +++ b/lib/handle_pubackcomp.c @@ -100,6 +100,7 @@ int handle__pubackcomp(struct mosquitto *mosq, const char *type) && reason_code != MQTT_RC_PAYLOAD_FORMAT_INVALID ){ + mosquitto_property_free_all(&properties); return MOSQ_ERR_PROTOCOL; } }else{ @@ -107,14 +108,13 @@ int handle__pubackcomp(struct mosquitto *mosq, const char *type) && reason_code != MQTT_RC_PACKET_ID_NOT_FOUND ){ + mosquitto_property_free_all(&properties); return MOSQ_ERR_PROTOCOL; } } } if(mosq->in_packet.pos < mosq->in_packet.remaining_length){ -#ifdef WITH_BROKER mosquitto_property_free_all(&properties); -#endif return MOSQ_ERR_MALFORMED_PACKET; }