From eeaafed48599d556ac8d09c8dac48cc749c92bff Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 30 Apr 2020 17:31:13 +0100 Subject: [PATCH] Fix memory leak when connecting clients rejected. --- ChangeLog.txt | 1 + src/handle_connect.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8888be82..22de95ef 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -4,6 +4,7 @@ Broker: - Fix `mosquitto_passwd -b` not updating passwords for existing users correctly. Creating a new user with `-b` worked without problem. Closes #1664. +- Fix memory leak when connecting clients rejected. Client library: - Don't treat an unexpected PUBACK, PUBREL, or PUBCOMP as a fatal error. diff --git a/src/handle_connect.c b/src/handle_connect.c index 99f1f1c3..6a9e198a 100644 --- a/src/handle_connect.c +++ b/src/handle_connect.c @@ -886,5 +886,7 @@ handle_connect_error: if(client_cert) X509_free(client_cert); #endif /* We return an error here which means the client is freed later on. */ + context->clean_start = true; + context->session_expiry_interval = 0; return rc; }