On the off chance the if statement takes the false branch, let's not leak the memory. again.

This commit is contained in:
William King 2013-06-12 16:46:21 -07:00
parent 5e5af427ef
commit a181ec629f
1 changed files with 2 additions and 0 deletions

View File

@ -1096,6 +1096,8 @@ JSObject *new_js_event(switch_event_t *event, char *name, JSContext * cx, JSObje
if ((Event = JS_DefineObject(cx, obj, name, &event_class, NULL, 0))) {
if ((JS_SetPrivate(cx, Event, eo) && JS_DefineProperties(cx, Event, event_props) && JS_DefineFunctions(cx, Event, event_methods))) {
}
} else {
free(eo);
}
}
return Event;