提交 a181ec62 authored 作者: William King's avatar William King

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

上级 5e5af427
...@@ -1096,6 +1096,8 @@ JSObject *new_js_event(switch_event_t *event, char *name, JSContext * cx, JSObje ...@@ -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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论