Opened 7 days ago

Closed 28 hours ago

#32667 closed defect (fixed)

CID 1456199: Resource leak in test_hs_control_store_permanent_creds()

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

Description

** CID 1456199:  Resource leaks  (RESOURCE_LEAK)
/src/test/test_hs_control.c: 534 in test_hs_control_store_permanent_creds()

________________________________________________________________________________________________________
*** CID 1456199:  Resource leaks  (RESOURCE_LEAK)
/src/test/test_hs_control.c: 534 in test_hs_control_store_permanent_creds()
528     
529         #ifdef _WIN32
530           ret = mkdir(perm_creds_dir);
531         #else
532           ret = mkdir(perm_creds_dir, 0700);
533         #endif
>>>     CID 1456199:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "perm_creds_dir" going out of scope leaks the storage it points to.
534         tt_int_op(ret, OP_EQ, 0);
535     
536         get_options_mutable()->ClientOnionAuthDir = perm_creds_dir;
537       }
538     
539       tor_free(args);

Child Tickets

Change History (4)

comment:1 Changed 7 days ago by asn

Status: newneeds_review

Please see https://github.com/torproject/tor/pull/1583 for a possible fix here!

comment:2 Changed 7 days ago by dgoulet

Status: needs_reviewneeds_revision

I don't think this will work? Reason is that if tt_int_op(ret, OP_EQ, 0); fails, your ClientOnionAuthDir is not set to the perm_creds_dir...

comment:3 Changed 7 days ago by asn

Status: needs_revisionneeds_review

Good point. Pushed a fixup!

comment:4 Changed 28 hours ago by dgoulet

Resolution: fixed
Status: needs_reviewclosed

Merged!

Note: See TracTickets for help on using tickets.