Opened 3 months ago

Closed 2 months ago

#32356 closed defect (fixed)

hs-v3: Memory leak in rend_client_get_random_intro_impl()

Reported by: dgoulet Owned by:
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-hs
Cc: Actual Points: 0.1
Parent ID: Points: 0.1
Reviewer: nickm Sponsor: Sponsor27-must

Description

From coverity report:

** CID 1455168:  Resource leaks  (RESOURCE_LEAK)
/src/feature/rend/rendclient.c: 1061 in rend_client_get_random_intro_impl()


________________________________________________________________________________________________________
*** CID 1455168:  Resource leaks  (RESOURCE_LEAK)
/src/feature/rend/rendclient.c: 1061 in rend_client_get_random_intro_impl()
1055       usable_nodes = smartlist_new();
1056       smartlist_add_all(usable_nodes, entry->parsed->intro_nodes);
1057     
1058       /* Get service ID so we can use it to query the failure cache. If we fail to
1059        * parse it, this cache entry is no good. */
1060       if (BUG(rend_get_service_id(entry->parsed->pk, service_id) < 0)) {
>>>     CID 1455168:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "usable_nodes" going out of scope leaks the storage it points to.
1061         return NULL;
1062       }

Was just introduced couple days ago.

Child Tickets

Change History (3)

comment:1 Changed 2 months ago by dgoulet

Status: newneeds_review

Branch: ticket32356_043_01
PR: https://github.com/torproject/tor/pull/1498

Memleak on recent changes on 0.4.3 git master. Original fix wasn't backported.

comment:2 Changed 2 months ago by nickm

Status: needs_reviewmerge_ready

LGTM; feel free to merge once CI passes.

comment:3 Changed 2 months ago by dgoulet

Actual Points: 0.1
Resolution: fixed
Reviewer: nickm
Status: merge_readyclosed

Merged!

Note: See TracTickets for help on using tickets.