From: William King Date: Wed, 12 Jun 2013 23:41:06 +0000 (-0700) Subject: On the off chance the if statement takes the false branch, let's not leak the memory X-Git-Tag: v1.4.1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e5af427ef021bb6f0dadf8ddb21c54bbd30c1dc;p=thirdparty%2Ffreeswitch.git On the off chance the if statement takes the false branch, let's not leak the memory --- diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 552c2c45f0..4e7d957122 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -1112,6 +1112,8 @@ JSObject *new_js_dtmf(switch_dtmf_t *dtmf, char *name, JSContext * cx, JSObject JS_SetPrivate(cx, DTMF, ddtmf); JS_DefineProperties(cx, DTMF, dtmf_props); JS_DefineFunctions(cx, DTMF, dtmf_methods); + } else { + free(ddtmf); } } return DTMF;