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 9ce6ce082f
commit dac6ce1b45
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,7 @@
* Contributor(s): * Contributor(s):
* *
* Anthony Minessale II <anthm@freeswitch.org> * Anthony Minessale II <anthm@freeswitch.org>
* * William King <william.king@quentustech.com>
* *
* mod_spidermonkey.c -- Javascript Module * 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))) { if ((xml = switch_event_xmlize(ro->stream->param_event, SWITCH_VA_NONE))) {
xmlstr = switch_xml_toxml(xml, SWITCH_FALSE); xmlstr = switch_xml_toxml(xml, SWITCH_FALSE);
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, xmlstr)); *rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, xmlstr));
free(xmlstr);
return JS_TRUE; return JS_TRUE;
} }
} else { } else {