Bug 634752 - Always drop jsPrincipals before returning from LoadSubScript, r+a=jst

This commit is contained in:
Michael Wu 2011-02-17 14:20:00 -08:00
parent 94bec0d5a6
commit 6b366b61a3

View File

@ -392,6 +392,7 @@ mozJSSubScriptLoader::LoadSubScript (const PRUnichar * aURL
if (NS_FAILED(rv))
{
JSPRINCIPALS_DROP(cx, jsPrincipals);
errmsg = JS_NewStringCopyZ(cx, LOAD_ERROR_BADCHARSET);
goto return_exception;
}
@ -405,6 +406,8 @@ mozJSSubScriptLoader::LoadSubScript (const PRUnichar * aURL
buf, len, uriStr.get(), 1, rval);
}
JSPRINCIPALS_DROP(cx, jsPrincipals);
if (ok)
{
JSAutoEnterCompartment rac;
@ -417,8 +420,6 @@ mozJSSubScriptLoader::LoadSubScript (const PRUnichar * aURL
JS_SetErrorReporter (cx, er);
cc->SetReturnValueWasSet (ok);
JSPRINCIPALS_DROP(cx, jsPrincipals);
return NS_OK;
return_exception: