From a181ec629f924ed15a6ab93f1b433c6fc47e8eae Mon Sep 17 00:00:00 2001 From: William King Date: Wed, 12 Jun 2013 16:46:21 -0700 Subject: [PATCH] On the off chance the if statement takes the false branch, let's not leak the memory. again. --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 4e7d957122..79f551f687 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -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;