Fix leak on error.

This commit is contained in:
Roger A. Light 2023-04-12 11:52:26 +01:00
parent 6d240a9d18
commit 3c51816009

View File

@ -946,7 +946,13 @@ handle_connect_error:
mosquitto__free(will_struct->msg.topic);
mosquitto__free(will_struct);
}
if(context->will){
mosquitto_property_free_all(&context->will->properties);
mosquitto__free(context->will->msg.payload);
mosquitto__free(context->will->msg.topic);
mosquitto__free(context->will);
context->will = NULL;
}
#ifdef WITH_TLS
if(client_cert) X509_free(client_cert);
#endif