]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Free localuser structure when we fail to dial (issue #8612 reported by rizzo)
authorJoshua Colp <jcolp@digium.com>
Tue, 19 Dec 2006 21:10:26 +0000 (21:10 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 19 Dec 2006 21:10:26 +0000 (21:10 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@48584 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c

index 662a2142aa92195ba57b0a80162f69c3deb34b1a..c7fe8762dc1c4058e5d7c865eed4265cf87aeba1 100644 (file)
@@ -1058,6 +1058,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        cur = rest;
                        if (!cur)
                                chan->hangupcause = cause;
+                       free(tmp);
                        continue;
                }
                pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
@@ -1096,6 +1097,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        if (!tmp->chan) {
                                HANDLE_CAUSE(cause, chan);
                                cur = rest;
+                               free(tmp);
                                continue;
                        }
                }
@@ -1163,6 +1165,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        ast_hangup(tmp->chan);
                        tmp->chan = NULL;
                        cur = rest;
+                       free(tmp);
                        continue;
                } else {
                        senddialevent(chan, tmp->chan);