1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

In init_smjs, destroy the runtime if JS_NewContext returns NULL.

This commit is contained in:
Miciah Dashiel Butler Masters 2005-12-19 21:26:05 +00:00 committed by Miciah Dashiel Butler Masters
parent fcd13e35cb
commit 2b6ef067be

View File

@ -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);