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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@366167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2012-05-10 20:50:47 +00:00
parent ae528efea3
commit a94fcae21b
27 changed files with 325 additions and 365 deletions

View File

@@ -2496,18 +2496,20 @@ struct ast_data_iterator *ast_data_iterator_init(struct ast_data *tree,
struct ast_data *internal = tree;
char *path, *ptr = NULL;
if (!elements) {
return NULL;
}
/* tree is the node we want to use to iterate? or we are going
* to iterate thow an internal node? */
if (elements) {
path = ast_strdupa(elements);
path = ast_strdupa(elements);
ptr = strrchr(path, '/');
if (ptr) {
*ptr = '\0';
internal = data_result_get_node(tree, path);
if (!internal) {
return NULL;
}
ptr = strrchr(path, '/');
if (ptr) {
*ptr = '\0';
internal = data_result_get_node(tree, path);
if (!internal) {
return NULL;
}
}