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/cdr.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/cdr.c')
-rw-r--r-- | main/cdr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/cdr.c b/main/cdr.c index f0ba2ea2e..18d53b2a3 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -581,7 +581,9 @@ void ast_cdr_merge(struct ast_cdr *to, struct ast_cdr *from) lfrom = lfrom->next; } /* rip off the last entry and put a copy of the to at the end */ - llfrom->next = to; + if (llfrom) { + llfrom->next = to; + } from = lfrom; } else { /* save copy of the current *to cdr */ @@ -597,10 +599,11 @@ void ast_cdr_merge(struct ast_cdr *to, struct ast_cdr *from) } from->next = NULL; /* rip off the last entry and put a copy of the to at the end */ - if (llfrom == from) + if (llfrom == from) { to = to->next = ast_cdr_dup(&tcdr); - else + } else if (llfrom) { to = llfrom->next = ast_cdr_dup(&tcdr); + } from = lfrom; } } |