diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-20 17:34:00 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-20 17:34:00 +0000 |
commit | 14f8841aabb50ebfa79ed487cc9517001c86011a (patch) | |
tree | d1a6834039534bc488f297d5cf25c830cbc0c8e5 /apps/app_directed_pickup.c | |
parent | 33b057f6e479c00c23759340a753bc72e9501fc4 (diff) |
backport fix for segfault on directed pickup when no CDR is available (issue #5998)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7550 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directed_pickup.c')
-rw-r--r-- | apps/app_directed_pickup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c index 7008ff083..9e7d3cc84 100644 --- a/apps/app_directed_pickup.c +++ b/apps/app_directed_pickup.c @@ -77,7 +77,7 @@ static int pickup_exec(struct ast_channel *chan, void *data) /* Find a channel to pickup */ origin = ast_get_channel_by_exten_locked(exten, context); - if (origin) { + if (origin && origin->cdr) { ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace, sizeof(workspace), 0); if (tmp) { @@ -89,6 +89,8 @@ static int pickup_exec(struct ast_channel *chan, void *data) } ast_mutex_unlock(&origin->lock); } else { + if (origin) + ast_mutex_unlock(&origin->lock); ast_log(LOG_DEBUG, "No originating channel found.\n"); } |