summaryrefslogtreecommitdiff
path: root/apps/app_directed_pickup.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2009-07-22 14:35:01 +0000
committerMark Michelson <mmichelson@digium.com>2009-07-22 14:35:01 +0000
commit33852cfaf6ead4efd31113237bb0bb69a94d2cef (patch)
treead4fd1fd734e2f3647d415dc99931cfbbc343a66 /apps/app_directed_pickup.c
parent16328efb78cf83c57355682bff1e2b09efa612db (diff)
Fix the crash in directed pickups. For real this time.
A shallow pointer copy was causing an ast_party_connected_line structure to be freed multiple times, thus causing a crash. (closes issue #15441) Reported by: lmsteffan Patches: 15441.patch uploaded by mmichelson (license 60) Tested by: lmsteffan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_directed_pickup.c')
-rw-r--r--apps/app_directed_pickup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c
index 9301395c8..8a8297e97 100644
--- a/apps/app_directed_pickup.c
+++ b/apps/app_directed_pickup.c
@@ -98,11 +98,13 @@ static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
ast_debug(1, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
ast_cel_report_event(target, AST_CEL_PICKUP, NULL, NULL, chan);
- connected_caller = target->connected;
+ ast_party_connected_line_init(&connected_caller);
+ ast_party_connected_line_copy(&connected_caller, &target->connected);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
if (ast_channel_connected_line_macro(NULL, chan, &connected_caller, 0, 0)) {
ast_channel_update_connected_line(chan, &connected_caller);
}
+ ast_party_connected_line_free(&connected_caller);
ast_channel_lock(chan);
ast_connected_line_copy_from_caller(&connected_caller, &chan->cid);