From: Dragos Oancea Date: Fri, 21 Feb 2020 07:00:18 +0000 (+0000) Subject: [core] scan-build: Function call argument is an uninitialized value - switch_xml_set_... X-Git-Tag: v1.10.3^2~133^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6f5869474531217f3dca0e07d2b3fbe2f3372ae;p=thirdparty%2Ffreeswitch.git [core] scan-build: Function call argument is an uninitialized value - switch_xml_set_attr() --- diff --git a/src/switch_xml.c b/src/switch_xml.c index f5bccd5d86..42424ef3a3 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -2985,6 +2985,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_set_attr(switch_xml_t xml, const char *n 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(""); } else { xml->attr = (char **) switch_must_realloc(xml->attr, (l + 4) * sizeof(char *)); }