Closed Bug 603722 Opened 9 years ago Closed 9 years ago

XrayWrapper holder_enumerate leaks ida when ResolveNativeProperty fails

Categories

(Core :: XPConnect, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, memory-leak)

233 holder_enumerate(JSContext *cx, JSObject *holder)
234 {
235     // Ask the native wrapper for all its ids

allocate:
236     JSIdArray *ida = JS_Enumerate(cx, GetWrappedNativeObjectFromHolder(holder));

allocation established as real:
237     if (!ida)
238         return false;
239     jsid *idp = ida->vector;
240     size_t length = ida->length;
241     // Resolve the underlyign native properties onto the holder object
242     while (length-- > 0) {
243         JSPropertyDescriptor dummy;

fails = not rooted:
244         if (!ResolveNativeProperty(cx, holder, *idp++, false, &dummy))
bail => leak ida:
245             return false;
246     }
247     return true;
248 }
I'm going to mark this straight as fixed (though it's only fixed-on-tracemonkey at the moment). This was fixed by gal's rewrite of xraywrapper's enumeration code.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.