diff options
author | Kinsey Moore <kmoore@digium.com> | 2012-05-10 20:56:09 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2012-05-10 20:56:09 +0000 |
commit | dd81b047dbf15a501b81354db505daf50703a1a0 (patch) | |
tree | 01754d4206c865653717baf23e47ed264f7a6b3d /main/xmldoc.c | |
parent | 8227f70cd70f497cb03c1f9aab63950bcd979d8b (diff) |
Resolve FORWARD_NULL static analysis warnings
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20,
22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111,
and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped
were either extended/deprecated or in areas of code that shouldn't be
disturbed.
(Closes issue ASTERISK-19650)
........
Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/xmldoc.c')
-rw-r--r-- | main/xmldoc.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/main/xmldoc.c b/main/xmldoc.c index f3deb5dc3..2735583ab 100644 --- a/main/xmldoc.c +++ b/main/xmldoc.c @@ -976,26 +976,28 @@ static char *xmldoc_get_syntax_cmd(struct ast_xml_node *fixnode, const char *nam /* is this a recursive parameter. */ paramname = xmldoc_get_syntax_cmd(node, "", 0); isenum = 1; - } else if (!xmldoc_has_inside(node, "enumlist")) { - /* this is a simple parameter. */ - attrname = ast_xml_get_attribute(node, "name"); - if (!attrname) { - /* ignore this bogus parameter and continue. */ - continue; - } - paramname = ast_strdup(attrname); - ast_xml_free_attr(attrname); - isenum = 0; } else { - /* parse enumlist (note that this is a special enumlist - that is used to describe a syntax like {<param1>|<param2>|...} */ for (tmpnode = ast_xml_node_get_children(node); tmpnode; tmpnode = ast_xml_node_get_next(tmpnode)) { if (!strcasecmp(ast_xml_node_get_name(tmpnode), "enumlist")) { break; } } - paramname = xmldoc_parse_cmd_enumlist(tmpnode); - isenum = 1; + if (tmpnode) { + /* parse enumlist (note that this is a special enumlist + that is used to describe a syntax like {<param1>|<param2>|...} */ + paramname = xmldoc_parse_cmd_enumlist(tmpnode); + isenum = 1; + } else { + /* this is a simple parameter. */ + attrname = ast_xml_get_attribute(node, "name"); + if (!attrname) { + /* ignore this bogus parameter and continue. */ + continue; + } + paramname = ast_strdup(attrname); + ast_xml_free_attr(attrname); + isenum = 0; + } } /* Is this parameter required? */ |