Skip to content

Commit

Permalink
Fix memory leak when connecting clients rejected.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Apr 30, 2020
1 parent 5908585 commit eeaafed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/handle_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,5 +886,7 @@ int handle__connect(struct mosquitto_db *db, struct mosquitto *context)
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;
}

0 comments on commit eeaafed

Please sign in to comment.