Closed
Bug 617964
Opened 15 years ago
Closed 12 years ago
jsd_NewValue leaks jsdval when JS_EnterCrossCompartmentCall fails
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla2.0
People
(Reporter: timeless, Assigned: timeless)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, memory-leak, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
558 bytes,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
283 jsd_NewValue(JSDContext* jsdc, jsval val)
284 {
285 JSDValue* jsdval;
286 JSCrossCompartmentCall *call = NULL;
287
alloc site:
288 if(!(jsdval = (JSDValue*) calloc(1, sizeof(JSDValue))))
289 return NULL;
296 call = JS_EnterCrossCompartmentCall(jsdc->dumbContext, jsdc->glob);
297 if(!call) {
298 JS_EndRequest(jsdc->dumbContext);
leak site: (thank you mrbkap, gal)
299
300 return NULL;
301 }
303 ok = JS_AddNamedValueRoot(jsdc->dumbContext, &jsdval->val, "JSDValue");
304 JS_LeaveCrossCompartmentCall(call);
305 JS_EndRequest(jsdc->dumbContext);
306 if(!ok)
307 {
does not leak site: (please follow when in rome!)
308 free(jsdval);
309 return NULL;
Updated•15 years ago
|
Attachment #496596 -
Flags: review?(jorendorff) → review+
Updated•15 years ago
|
Keywords: checkin-needed
Comment 2•15 years ago
|
||
Keywords: checkin-needed
Whiteboard: fixed-in-tracemonkey
Updated•14 years ago
|
Component: JavaScript Debugging/Profiling APIs → JavaScript Engine
Comment 3•12 years ago
|
||
The patch landed, and the bug is fixed. Closing.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Target Milestone: --- → mozilla2.0
Updated•7 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•