Opened 7 weeks ago

Closed 6 weeks ago

#28989 closed defect (fixed)

test_hs_service: CID 1442277: Resource leaks (RESOURCE_LEAK)

Reported by: asn Owned by: rl1987
Priority: Medium Milestone: Tor: 0.4.0.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-hs coverity
Cc: Actual Points:
Parent ID: Points:
Reviewer: asn Sponsor:

Description

/src/test/test_hs_service.c: 1657 in test_build_descriptors()
1651       {
1652         hs_service_t *service = helper_create_service();
1653         service_descriptor_free(service->desc_current);
1654         service->desc_current = NULL;
1655     
1656         build_all_descriptors(now);
>>>     CID 1442277:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "service" going out of scope leaks the storage it points to.
1657         tt_assert(service->desc_current);
1658         tt_assert(service->desc_current->desc);

Child Tickets

Change History (7)

comment:1 Changed 7 weeks ago by rl1987

Status: newneeds_review

comment:2 Changed 6 weeks ago by nickm

Status: needs_reviewneeds_revision

Left a couple of comments on the patch. I think we need to call the cleanup code in the done: block, so that coverity sees that it is always called, regardless of whether the tests pass or fail.

comment:3 Changed 6 weeks ago by rl1987

Owner: set to rl1987
Status: needs_revisionaccepted

comment:4 Changed 6 weeks ago by rl1987

Status: acceptedneeds_review

That should be fixed now.

comment:5 Changed 6 weeks ago by dgoulet

Reviewer: asn

comment:6 Changed 6 weeks ago by asn

Status: needs_reviewmerge_ready

LGTM

comment:7 Changed 6 weeks ago by nickm

Resolution: fixed
Status: merge_readyclosed

Okay, squashed and merged. Let's reopen if coverity doesn't like it.

Note: See TracTickets for help on using tickets.