Skip to content
Snippets Groups Projects
Commit e089564a authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

May as well check the signature in the OnExit handler too.

parent a32b5ade
No related branches found
No related tags found
No related merge requests found
......@@ -799,7 +799,7 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_callback_t* cb)
BOOL auto_terminate=cb->auto_terminate;
JSObject *glob=JS_GetGlobalObject(cx);
global_private_t *pt;
str_list_t list;
str_list_t list = NULL;
if(glob==obj) {
pt=(global_private_t *)JS_GetPrivate(cx,JS_GetGlobalObject(cx));
......@@ -807,11 +807,17 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_callback_t* cb)
}
else {
struct onexit_private *oep = JS_GetPrivate(cx,obj);
if (oep == NULL)
list = NULL;
else {
list = oep->list;
free(oep);
if (oep != NULL) {
if (oep->signature[0] == 'o'
|| oep->signature[1] == 'n'
|| oep->signature[2] == 'e'
|| oep->signature[3] == 'x'
|| oep->signature[4] == 'i'
|| oep->signature[5] == 't'
|| oep->signature[6] == 0) {
list = oep->list;
free(oep);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment