Plug a memory leak in app_dial.
authorMark Michelson <mmichelson@digium.com>
Wed, 20 May 2009 20:14:28 +0000 (20:14 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 20 May 2009 20:14:28 +0000 (20:14 +0000)
Since we may have copied connected line info into the chanlist struct prior
to placing an outbound call, we need to be sure to free the allocated data
when we hang the call up.

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

apps/app_dial.c

index fb14ac0..790e49f 100644 (file)
@@ -594,6 +594,7 @@ static void hanguptree(struct chanlist *outgoing, struct ast_channel *exception,
                                /* This is for the channel drivers */
                                outgoing->chan->hangupcause = AST_CAUSE_ANSWERED_ELSEWHERE;
                        }
+                       ast_party_connected_line_free(&outgoing->connected);
                        ast_hangup(outgoing->chan);
                }
                oo = outgoing;