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 /channels/chan_dahdi.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 'channels/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 9a2352080..bead03a8a 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -8937,7 +8937,9 @@ static struct ast_frame *__dahdi_exception(struct ast_channel *ast) ast_debug(1, "Exception on %d, channel %d\n", ast_channel_fd(ast, 0), p->channel); /* If it's not us, return NULL immediately */ if (ast != p->owner) { - ast_log(LOG_WARNING, "We're %s, not %s\n", ast_channel_name(ast), ast_channel_name(p->owner)); + if (p->owner) { + ast_log(LOG_WARNING, "We're %s, not %s\n", ast_channel_name(ast), ast_channel_name(p->owner)); + } f = &p->subs[idx].f; return f; } @@ -11778,14 +11780,13 @@ static void *do_monitor(void *data) count = 0; for (i = iflist; i; i = i->next) { ast_mutex_lock(&i->lock); - if ((i->subs[SUB_REAL].dfd > -1) && i->sig && (!i->radio) && !(i->sig & SIG_MFCR2)) { + if (pfds && (i->subs[SUB_REAL].dfd > -1) && i->sig && (!i->radio) && !(i->sig & SIG_MFCR2)) { if (analog_lib_handles(i->sig, i->radio, i->oprmode)) { struct analog_pvt *p = i->sig_pvt; - if (!p) + if (!p) { ast_log(LOG_ERROR, "No sig_pvt?\n"); - - if (!p->owner && !p->subs[SUB_REAL].owner) { + } else if (!p->owner && !p->subs[SUB_REAL].owner) { /* This needs to be watched, as it lacks an owner */ pfds[count].fd = i->subs[SUB_REAL].dfd; pfds[count].events = POLLPRI; |