FS-5443: --resolve leaked because the JS api's copy and return new malloc'd pointers.

This commit is contained in:
William King 2013-05-18 15:47:01 -07:00
parent 7f3f4855a6
commit 09553f424a
1 changed files with 2 additions and 1 deletions

View 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 {