Commit 8e402cbc authored by rswindell's avatar rswindell
Browse files

Fix more memory leaks (in error conditions) discovered by clang scan-build.

parent b56469fb
......@@ -979,6 +979,7 @@ js_findstr(JSContext *cx, uintN argc, jsval *arglist)
JSSTRING_TO_MSTRING(cx, js_str, str, NULL);
if(JS_IsExceptionPending(cx)) {
FREE_AND_NULL(str);
free(fname);
return JS_FALSE;
}
......
......@@ -875,8 +875,10 @@ js_write(JSContext *cx, uintN argc, jsval *arglist)
return(JS_FALSE);
for (i = 0; i < argc; i++) {
if((str=JS_ValueToString(cx, argv[i]))==NULL)
if((str=JS_ValueToString(cx, argv[i]))==NULL) {
FREE_AND_NULL(cstr);
return(JS_FALSE);
}
JSSTRING_TO_RASTRING(cx, str, cstr, &cstr_sz, NULL);
if(cstr==NULL)
return(JS_FALSE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment