Skip to content

Commit

Permalink
quickjs: fix use-after-free on error during module evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Nov 7, 2023
1 parent ea12306 commit 8f38ff5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deps/quickjs/src/quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,8 @@ static void js_free_modules(JSContext *ctx, JSFreeModuleEnum flag)
JSModuleDef *m = list_entry(el, JSModuleDef, link);
if (flag == JS_FREE_MODULE_ALL ||
(flag == JS_FREE_MODULE_NOT_RESOLVED && !m->resolved) ||
(flag == JS_FREE_MODULE_NOT_EVALUATED && !m->evaluated)) {
(flag == JS_FREE_MODULE_NOT_EVALUATED && !m->evaluated
&& !m->eval_mark)) {
js_free_module_def(ctx, m);
}
}
Expand Down

0 comments on commit 8f38ff5

Please sign in to comment.