Bug 646380 - jsd_GetValueString needs to null out 'call' after leaving the cross compartment call (r=sphink)
authorLuke Wagner <luke@mozilla.com>
Thu, 31 Mar 2011 15:29:44 -0400
changeset 64525 a538db9ab6195dfc5585f58401a45b8b29d4c60a
parent 64524 06ed3a52effd3a8a5668aff361d602414f96d7e4
child 64526 400281b76ce46e119402352c62712df026fadb71
push idunknown
push userunknown
push dateunknown
reviewerssphink
bugs646380
milestone2.2a1pre
Bug 646380 - jsd_GetValueString needs to null out 'call' after leaving the cross compartment call (r=sphink)
js/jsd/jsd_val.c
--- a/js/jsd/jsd_val.c
+++ b/js/jsd/jsd_val.c
@@ -235,16 +235,17 @@ jsd_GetValueString(JSDContext* jsdc, JSD
         return NULL;
     }
     exceptionState = JS_SaveExceptionState(cx);
 
     string = JS_ValueToString(cx, jsdval->val);
 
     JS_RestoreExceptionState(cx, exceptionState);
     JS_LeaveCrossCompartmentCall(call);
+    call = NULL;
 
     if(string) {
         stringval = STRING_TO_JSVAL(string);
         call = JS_EnterCrossCompartmentCall(cx, jsdc->glob);
     }
     if(!string || !call || !JS_WrapValue(cx, &stringval)) {
         if(call)
             JS_LeaveCrossCompartmentCall(call);