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 added a mosquitto__free(reason_codes) statement before each return
statement that could result to a memory leak
Signed-off-by: Panagiotis Vasilikos <panagiotis.vasilikos@alexandra.dk>
Reason: The memory allocated for the packet pointer at line 155 is not freed
before returning at line 188.
Fix: I inserted the mosquitto__free(packet) statement just before returning
at line 188.
Signed-off-by: Panagiotis Vasilikos <panagiotis.vasilikos@alexandra.dk>
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: Panagiotis Vasilikos <panagiotis.vasilikos@alexandra.dk>
This allow more libraries to be linked when compiling the clients with a
static libmosquitto, as required for e.g. openssl on some systems.
Closes#1371. Thanks to Fabrice Fontaine.
Fix test on invalid null will topic value in connect packet
Fix test on invalid reserved bit value in connect packet
Add send of pubcomp in 02-subpub-qos2 script. To keep the broker session working while launching several tests on the same broker, the last packet of this transaction must be sent.
Fix way of sending packets in compliance tests. According to the documentation of python 3 socket::send method (https://docs.python.org/3/library/socket.html#socket.socket.send), the call to send must be retry until all data is sent while sending packet with a "large" amount of data.
To keep the broker session working while launching several tests on
the same broker, the last packet of this transaction must be sent.
Signed-off-by: Jerome Malinge <gromgromm@yahoo.com>
According to the documentation of python 3 socket::send method
(https://docs.python.org/3/library/socket.html#socket.socket.send),
the call to send must be retry until all data is sent while sending
packet with a "large" amount of data.
Signed-off-by: Jerome Malinge <gromgromm@yahoo.com>