Memory leak in socks_mosq.c

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>
pull/1574/head
Panagiotis Vasilikos 6 years ago
parent 0f7052564c
commit caeb211cc5

@ -185,6 +185,7 @@ int socks5__send(struct mosquitto *mosq)
}else{
slen = strlen(mosq->host);
if(slen > UCHAR_MAX){
mosquitto__free(packet);
return MOSQ_ERR_NOMEM;
}
packet->packet_length = 7 + slen;

Loading…
Cancel
Save