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
This commit is contained in:
Kinsey Moore
2012-05-10 20:56:09 +00:00
parent 8227f70cd7
commit dd81b047db
27 changed files with 328 additions and 368 deletions

View File

@@ -2967,11 +2967,6 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds,
int fdno;
} *fdmap = NULL;
if ((sz = n * AST_MAX_FDS + nfds)) {
pfds = alloca(sizeof(*pfds) * sz);
fdmap = alloca(sizeof(*fdmap) * sz);
}
if (outfd) {
*outfd = -99999;
}
@@ -2979,6 +2974,14 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds,
*exception = 0;
}
if ((sz = n * AST_MAX_FDS + nfds)) {
pfds = alloca(sizeof(*pfds) * sz);
fdmap = alloca(sizeof(*fdmap) * sz);
} else {
/* nothing to allocate and no FDs to check */
return NULL;
}
/* Perform any pending masquerades */
for (x = 0; x < n; x++) {
if (ast_channel_masq(c[x]) && ast_do_masquerade(c[x])) {