Fix Coverity 1486949

This commit is contained in:
Roger A. Light 2022-08-31 11:36:53 +01:00
parent f44d8fad50
commit 5c3c5d779f

View File

@ -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;
}