On the off chance the if statement takes the false branch, let's not leak the memory. again.
This commit is contained in:
parent
5e5af427ef
commit
a181ec629f
|
@ -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 ((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))) {
|
if ((JS_SetPrivate(cx, Event, eo) && JS_DefineProperties(cx, Event, event_props) && JS_DefineFunctions(cx, Event, event_methods))) {
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
free(eo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Event;
|
return Event;
|
||||||
|
|
Loading…
Reference in New Issue