mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@48574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1295,6 +1295,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
|||||||
handle_cause(cause, &num);
|
handle_cause(cause, &num);
|
||||||
if (!rest) /* we are on the last destination */
|
if (!rest) /* we are on the last destination */
|
||||||
chan->hangupcause = cause;
|
chan->hangupcause = cause;
|
||||||
|
free(tmp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
|
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) {
|
if (!tmp->chan) {
|
||||||
handle_cause(cause, &num);
|
handle_cause(cause, &num);
|
||||||
|
free(tmp);
|
||||||
continue;
|
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_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
|
||||||
ast_hangup(tmp->chan);
|
ast_hangup(tmp->chan);
|
||||||
tmp->chan = NULL;
|
tmp->chan = NULL;
|
||||||
|
free(tmp);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
senddialevent(chan, tmp->chan);
|
senddialevent(chan, tmp->chan);
|
||||||
|
Reference in New Issue
Block a user