Don't blow up on a NULL cdr.
authorRussell Bryant <russell@russellbryant.com>
Wed, 19 Aug 2009 15:32:18 +0000 (15:32 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 19 Aug 2009 15:32:18 +0000 (15:32 +0000)
Reported in #asterisk-dev.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213046 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/features.c

index becb6ea..9f14551 100644 (file)
@@ -3120,7 +3120,9 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
                                chan_ptr = ast_channel_unref(chan_ptr);
                        }
                        /* new channel */
-                       ast_cdr_specialized_reset(new_peer_cdr, 0);
+                       if (new_peer_cdr) {
+                               ast_cdr_specialized_reset(new_peer_cdr, 0);
+                       }
                } else {
                        ast_cdr_specialized_reset(peer_cdr, 0); /* nothing changed, reset the peer_cdr  */
                }