From f3c7c4d445ce0c26ef51b31328fe009f31b95694 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 5 Jan 2022 02:15:42 +0300 Subject: [PATCH] [Core] scan-build: Fix false-positive bad free by switch_must_realloc() in switch_xml_proc_inst() --- src/switch_xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_xml.c b/src/switch_xml.c index 1a3ecef9b6..108473918f 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -795,7 +795,7 @@ static void switch_xml_proc_inst(switch_xml_root_t root, char *s, switch_size_t return; } - if (!root->pi || !root->pi[0]) { + if (root->pi == (char ***)(SWITCH_XML_NIL) || !root->pi || !root->pi[0]) { root->pi = (char ***) switch_must_malloc(sizeof(char **)); *(root->pi) = NULL; /* first pi */ }