From: Andrey Volk Date: Mon, 27 Apr 2020 13:22:32 +0000 (+0400) Subject: [Core] Fix leak in switch_xml_set_attr(). X-Git-Tag: v1.10.3^2~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53cd06900c5ce827b2c0ac74485607d9a07d4a7d;p=thirdparty%2Ffreeswitch.git [Core] Fix leak in switch_xml_set_attr(). --- diff --git a/src/switch_xml.c b/src/switch_xml.c index 42424ef3a3..b05358741c 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -2984,8 +2984,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_set_attr(switch_xml_t xml, const char *n return xml; /* nothing to do */ if (xml->attr == SWITCH_XML_NIL) { /* first attribute */ xml->attr = (char **) switch_must_malloc(4 * sizeof(char *)); - xml->attr[1] = switch_must_strdup(""); /* empty list of malloced names/vals */ - xml->attr[l + 1] = switch_must_strdup(""); + xml->attr[l + 1] = switch_must_strdup(""); /* empty list of malloced names/vals */ } else { xml->attr = (char **) switch_must_realloc(xml->attr, (l + 4) * sizeof(char *)); }