Closed Bug 1024801 Opened 10 years ago Closed 10 years ago

nsUrlClassifierPrefixSet::GetPrefixes leaks |prefixArray| if it does |return NS_ERROR_FILE_CORRUPTED|

Categories

(Toolkit :: Safe Browsing, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, memory-leak, Whiteboard: [MemShrink:P3][CID 1221192])

Attachments

(2 files)

      No description provided.
Whiteboard: [MemShrink][CID 1221192] → [MemShrink:P3][CID 1221192]
Thinking about this some more, this one makes me a little nervous.  I'm guessing this array can be decently large, and I know with the old network cache they ended up getting corrupted or invalidating quite frequently, so maybe that's a possibility here.  I'll just fix this.
Assignee: nobody → continuation
Comment on attachment 8446015 [details] [diff] [review]
Free prefixArray if nsUrlClassifierPrefixSet::GetPrefixes returns an error.

Review of attachment 8446015 [details] [diff] [review]:
-----------------------------------------------------------------

It looks to me like the caller has exactly the same bug:
http://dxr.mozilla.org/mozilla-central/source/toolkit/components/url-classifier/LookupCache.cpp#699

This probably doesn't trigger right now because they're infallible arrays, but that tends to change. Can you fix that one as well?
Attachment #8446015 - Flags: review?(gpascutto) → review+
This is a little odd so I'm asking for review.
Attachment #8446049 - Flags: review?(gpascutto)
Attachment #8446049 - Flags: review?(gpascutto) → review+
https://hg.mozilla.org/mozilla-central/rev/11dccfc5d6c3
https://hg.mozilla.org/mozilla-central/rev/cc67c4e78d8d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: