mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
[core] scan-build: Function call argument is an uninitialized value - switch_xml_set_attr()
This commit is contained in:
parent
6609fc4ee2
commit
c6f5869474
@ -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 */
|
if (xml->attr == SWITCH_XML_NIL) { /* first attribute */
|
||||||
xml->attr = (char **) switch_must_malloc(4 * sizeof(char *));
|
xml->attr = (char **) switch_must_malloc(4 * sizeof(char *));
|
||||||
xml->attr[1] = switch_must_strdup(""); /* empty list of malloced names/vals */
|
xml->attr[1] = switch_must_strdup(""); /* empty list of malloced names/vals */
|
||||||
|
xml->attr[l + 1] = switch_must_strdup("");
|
||||||
} else {
|
} else {
|
||||||
xml->attr = (char **) switch_must_realloc(xml->attr, (l + 4) * sizeof(char *));
|
xml->attr = (char **) switch_must_realloc(xml->attr, (l + 4) * sizeof(char *));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user