From a4243ee919467d2d84e921b95e313dd5aa69457e Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 29 May 2019 18:42:38 +0100 Subject: [PATCH] Fix double free on exit in mosquitto_pub. Closes #1280. Thanks to Lucky Saini. --- ChangeLog.txt | 3 +++ client/pub_client.c | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index a98221a3..9f2c31dd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -43,6 +43,9 @@ Clients: - Fix MQTT v5 clients not being able to specify a password without a username. Closes #1274. +Clients: +- Fix double free on exit in mosquitto_pub. Closes #1280. + Documentation: - Remove references to Python binding and C++ wrapper in libmosquitto man page. Closes #1266. diff --git a/client/pub_client.c b/client/pub_client.c index f5521eac..ea7b61e0 100644 --- a/client/pub_client.c +++ b/client/pub_client.c @@ -508,6 +508,7 @@ int main(int argc, char *argv[]) if(cfg.message && cfg.pub_mode == MSGMODE_FILE){ free(cfg.message); + cfg.message = NULL; } mosquitto_destroy(mosq); mosquitto_lib_cleanup();