]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] scan-build: Fix false-positive bad free by switch_must_realloc() in switch_xml...
authorAndrey Volk <andywolk@gmail.com>
Tue, 4 Jan 2022 23:15:42 +0000 (02:15 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 9 Aug 2022 21:15:45 +0000 (00:15 +0300)
src/switch_xml.c

index 1a3ecef9b6dd08b168f97d87f15a56c1ac2db184..108473918f95ade803d9750156aadd8022e122f5 100644 (file)
@@ -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 */
        }