]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
On the off chance the if statement takes the false branch, let's not leak the memory...
authorWilliam King <william.king@quentustech.com>
Wed, 12 Jun 2013 23:46:21 +0000 (16:46 -0700)
committerWilliam King <william.king@quentustech.com>
Wed, 12 Jun 2013 23:46:38 +0000 (16:46 -0700)
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

index 4e7d9571228721fe5805f0430670bb54c5654981..79f551f687fed18e8836ee060d18206f057353b2 100644 (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;