From c27a878e53e0e4a27797eef23b68010d02144dc9 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 1 Aug 2019 14:49:19 +0100 Subject: [PATCH] Fix memory leak when setting v5 properties in mosquitto_connect_v5() --- ChangeLog.txt | 1 + lib/send_connect.c | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index a5fd7eb6..27b2c3e0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -23,6 +23,7 @@ Client library: - on_connect callback is now called with the correct v5 reason code if a v5 client connects to a v3.x broker and is sent a CONNACK with the "unacceptable protocol version" connack reason code. +- Fix memory leak when setting v5 properties in mosquitto_connect_v5(). Clients: - mosquitto_pub: fix error codes not being returned when mosquitto_pub exits. diff --git a/lib/send_connect.c b/lib/send_connect.c index 210f125a..e35e6332 100644 --- a/lib/send_connect.c +++ b/lib/send_connect.c @@ -168,6 +168,7 @@ int send__connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session property__write_all(packet, properties, false); property__write_all(packet, local_props, false); } + mosquitto_property_free_all(&local_props); /* Payload */ if(clientid){