Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
f6e34d37
Commit
f6e34d37
authored
Mar 29, 2020
by
rswindell
Browse files
Fix double-free (of startup_dir) in js.exec() method.
Improve "script missing" error reporting in js.exec().
parent
2cd195ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/sbbs3/js_internal.c
src/sbbs3/js_internal.c
+1
-2
No files found.
src/sbbs3/js_internal.c
View file @
f6e34d37
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment