mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-12 07:47:32 +08:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user