]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5443: --resolve leaked because the JS api's copy and return new malloc'd pointers.
authorWilliam King <william.king@quentustech.com>
Sat, 18 May 2013 22:47:01 +0000 (15:47 -0700)
committerWilliam King <william.king@quentustech.com>
Sat, 18 May 2013 22:47:51 +0000 (15:47 -0700)
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

index e6ab03b4d71108df73035ac8103b5a4cba1ae9fe..434c412cbfce4c5423aafa28d4158e4b1e7ed935 100644 (file)
@@ -24,7 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthm@freeswitch.org>
- *
+ * William King <william.king@quentustech.com>
  *
  * mod_spidermonkey.c -- Javascript Module
  *
@@ -247,6 +247,7 @@ static JSBool request_dump_env(JSContext * cx, JSObject * obj, uintN argc, jsval
                if ((xml = switch_event_xmlize(ro->stream->param_event, SWITCH_VA_NONE))) {
                        xmlstr = switch_xml_toxml(xml, SWITCH_FALSE);
                        *rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, xmlstr));
+                       free(xmlstr);
                        return JS_TRUE;
                }
        } else {