Commit f6e34d37 authored by rswindell's avatar rswindell
Browse files

Fix double-free (of startup_dir) in js.exec() method.

Improve "script missing" error reporting in js.exec().
parent 2cd195ea
......@@ -390,7 +390,7 @@ js_execfile(JSContext *cx, uintN argc, jsval *arglist)
free(cmd);
if(!fexistcase(path)) {
JS_ReportError(cx, "Can't find script");
JS_ReportError(cx, "Script file (%s) does not exist", path);
free(startup_dir);
return JS_FALSE;
}
......@@ -449,7 +449,6 @@ js_execfile(JSContext *cx, uintN argc, jsval *arglist)
if(js_script == NULL) {
/* If the script fails to compile, it's not a fatal error
* for the caller. */
free(startup_dir);
if (JS_IsExceptionPending(cx)) {
JS_GetPendingException(cx, &rval);
JS_SET_RVAL(cx, arglist, rval);
......
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