Commit 0f705256 authored by Panagiotis Vasilikos's avatar Panagiotis Vasilikos
Browse files

Memory leak in handle_unsubscribe.c



Reason: In line 70, the memory allocation for the pointer reasons_codes may
result to a memory leak due to the many returns (e.g as the one in line 78)
occuring in the program's path until reaching the mosquitto__free at line 122.

Fix: I moved the memory allocation code block (lines 69-73) just before
the line 102. This is the first place the pointer reason_codes is used, while
the following mosquitto__free operators free the allocated memory correctly.

Signed-off-by: default avatarPanagiotis Vasilikos <panagiotis.vasilikos@alexandra.dk>
parent 6aa9b91f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment