summaryrefslogtreecommitdiff
path: root/lib/mqtt.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-02-09 12:29:31 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-02-09 14:43:32 +0100
commitf9d1b2501186800f83c254663f64e7d08daa5c15 (patch)
treef96c6d4dd203726426fb6abb9d4841516f84ce63 /lib/mqtt.c
parentd9c61a9792cc4961dbc5258693843983b87ae485 (diff)
downloadcurl-f9d1b2501186800f83c254663f64e7d08daa5c15.tar.gz
mqtt: free 'sendleftovers' in disconnect
Fix a memory-leak Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43646 Closes #8415
Diffstat (limited to 'lib/mqtt.c')
-rw-r--r--lib/mqtt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mqtt.c b/lib/mqtt.c
index e0fa0aa8f..e79bd3b48 100644
--- a/lib/mqtt.c
+++ b/lib/mqtt.c
@@ -346,7 +346,9 @@ end:
static CURLcode mqtt_disconnect(struct Curl_easy *data)
{
CURLcode result = CURLE_OK;
+ struct MQTT *mq = data->req.p.mqtt;
result = mqtt_send(data, (char *)"\xe0\x00", 2);
+ Curl_safefree(mq->sendleftovers);
return result;
}