Last Comment Bug 693364 - Leak in CompartmentPrivate::RegisterDOMExpandoObject
: Leak in CompartmentPrivate::RegisterDOMExpandoObject
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla10
Assigned To: Peter Van der Beken [:peterv]
:
:
Mentors:
Depends on:
Blocks: 648801
  Show dependency treegraph
 
Reported: 2011-10-10 11:03 PDT by :Ms2ger (⌚ UTC+1/+2)
Modified: 2011-10-14 03:57 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (3.25 KB, patch)
2011-10-12 08:17 PDT, Peter Van der Beken [:peterv]
Ms2ger: review+
Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2011-10-10 11:03:03 PDT
http://mxr.mozilla.org/mozilla-central/source/js/src/xpconnect/src/xpcprivate.h?mark=4511-4516#4509

If Init fails, domExpandoMap is leaked.
Comment 1 Peter Van der Beken [:peterv] 2011-10-12 08:17:14 PDT
Created attachment 566534 [details] [diff] [review]
v1
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2011-10-12 08:28:10 PDT
Comment on attachment 566534 [details] [diff] [review]
v1

>--- a/js/src/xpconnect/src/xpcprivate.h
>+++ b/js/src/xpconnect/src/xpcprivate.h
>     bool RegisterExpandoObject(XPCWrappedNative *wn, JSObject *expando) {
>         if (!expandoMap) {
>             expandoMap = new nsDataHashtable<nsPtrHashKey<XPCWrappedNative>, JSObject *>();
>             if (!expandoMap->Init(8))
>+            {

{ on the same line, as above, please.

r=me, for what that's worth.
Comment 3 Peter Van der Beken [:peterv] 2011-10-13 07:28:40 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/fd296c912d24
Comment 4 Ed Morley [:emorley] 2011-10-14 03:57:34 PDT
https://hg.mozilla.org/mozilla-central/rev/fd296c912d24

Note You need to log in before you can comment on or make changes to this bug.