-
Notifications
You must be signed in to change notification settings - Fork 1.4k
two potential memory leaks #482
Copy link
Copy link
Closed
Labels
Milestone
Description
Hi guys
Here, it seems there are two memory leaks.
transmission/libtransmission/tr-dht.c
Lines 358 to 366 in eb5d1a7
| if (ss->udp_socket != TR_BAD_SOCKET && tr_variantDictFindRaw(&benc, TR_KEY_nodes, &raw, &len) && len % 6 == 0) | |
| { | |
| nodes = tr_memdup(raw, len); | |
| } | |
| if (ss->udp6_socket != TR_BAD_SOCKET && tr_variantDictFindRaw(&benc, TR_KEY_nodes6, &raw, &len6) && len6 % 18 == 0) | |
| { | |
| nodes6 = tr_memdup(raw, len6); | |
| } |
The pointers nodes and nodes6 in the above code point to two newly-allocated memory.
transmission/libtransmission/tr-dht.c
Lines 395 to 398 in eb5d1a7
| if (rc < 0) | |
| { | |
| goto fail; | |
| } |
If rc < 0 in the above code happens, it will go to the label fail, where nodes and nodes6 are not released.
Reactions are currently unavailable