diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-12-19 09:33:57 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-12-19 09:33:57 +0000 |
commit | 08bda8d1e398f9eb13fbfaa6f35e8054d252a7a9 (patch) | |
tree | 3be43ec19d4869127b07bc009ea92dbdbf379ae0 /apps/app_dial.c | |
parent | 1ba122f9dd6a0e9db7738b7a31d28cbc2ab2d9b0 (diff) |
stop what i think is a memory leak in case Dial fails to
connect to a channel.
Before committing to 1.4 i would like some other people to
review and test this fix - thanks.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48574 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index eba3ff53f..9ffd58589 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1295,6 +1295,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags handle_cause(cause, &num); if (!rest) /* we are on the last destination */ chan->hangupcause = cause; + free(tmp); continue; } pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst); @@ -1338,6 +1339,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags } if (!tmp->chan) { handle_cause(cause, &num); + free(tmp); continue; } } @@ -1398,6 +1400,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst); ast_hangup(tmp->chan); tmp->chan = NULL; + free(tmp); continue; } else { senddialevent(chan, tmp->chan); |