Possible memory leak in nsUrlClassifierLookupCallback::CompletionV4

RESOLVED FIXED in Firefox 55

Status

()

Toolkit
Safe Browsing
P2
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: dimi, Assigned: dimi)

Tracking

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: #sbv4-m6)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
This is found by Coverty Scan

*** CID 1405018:  Resource leaks  (RESOURCE_LEAK)
/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp: 1238 in nsUrlClassifierLookupCallback::CompletionV4(const nsACString &, const nsACString &, unsigned int, nsIArray *)()
1232       result->response.negativeCacheExpirySec = nowSec + aNegativeCacheDuration;
1233
1234       // Fill in positive cache entries.
1235       uint32_t fullHashCount = 0;
1236       nsresult rv = aFullHashes->GetLength(&fullHashCount);
1237       if (NS_FAILED(rv)) {
>>>     CID 1405018:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "result" going out of scope leaks the storage it points to.
1238         return rv;
1239       }
1240
1241       for (uint32_t i = 0; i < fullHashCount; i++) {
1242         nsCOMPtr<nsIFullHashMatch> match = do_QueryElementAt(aFullHashes, i);
1243
Dimi, do you think it's important enough to put in M6 or can we fix it during M7?
Flags: needinfo?(dlee)
Priority: -- → P2
Whiteboard: #sbv4-m6
(Assignee)

Comment 2

a year ago
(In reply to François Marier [:francois] from comment #1)
> Dimi, do you think it's important enough to put in M6 or can we fix it
> during M7?

It's not so critical because it won't cause memory leak unless aFullHashes->GetLength return error.
But I think we can leave it to M6 because it is regression of caching and is not very hard to fix.
Flags: needinfo?(dlee)
Comment hidden (mozreview-request)

Comment 4

a year ago
mozreview-review
Comment on attachment 8857809 [details]
Bug 1356067 - Fix memory leak in nsUrlClassifierLookupCallback::CompletionV4.

https://reviewboard.mozilla.org/r/129810/#review132730
Attachment #8857809 - Flags: review?(francois) → review+

Comment 6

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3c5efe2090ff
Fix memory leak in nsUrlClassifierLookupCallback::CompletionV4. r=francois
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/3c5efe2090ff
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.