mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
In init_smjs, destroy the runtime if JS_NewContext returns NULL.
This commit is contained in:
parent
fcd13e35cb
commit
2b6ef067be
@ -109,7 +109,11 @@ init_smjs(struct module *module)
|
||||
if (!smjs_rt) return;
|
||||
|
||||
smjs_ctx = JS_NewContext(smjs_rt, 8192);
|
||||
if (!smjs_ctx) return;
|
||||
if (!smjs_ctx) {
|
||||
JS_DestroyRuntime(smjs_rt);
|
||||
smjs_rt = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
JS_SetErrorReporter(smjs_ctx, error_reporter);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user