mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
backport fix for segfault on directed pickup when no CDR is available (issue #5998)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -77,7 +77,7 @@ static int pickup_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
/* Find a channel to pickup */
|
/* Find a channel to pickup */
|
||||||
origin = ast_get_channel_by_exten_locked(exten, context);
|
origin = ast_get_channel_by_exten_locked(exten, context);
|
||||||
if (origin) {
|
if (origin && origin->cdr) {
|
||||||
ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
|
ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
|
||||||
sizeof(workspace), 0);
|
sizeof(workspace), 0);
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
@@ -89,6 +89,8 @@ static int pickup_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
ast_mutex_unlock(&origin->lock);
|
ast_mutex_unlock(&origin->lock);
|
||||||
} else {
|
} else {
|
||||||
|
if (origin)
|
||||||
|
ast_mutex_unlock(&origin->lock);
|
||||||
ast_log(LOG_DEBUG, "No originating channel found.\n");
|
ast_log(LOG_DEBUG, "No originating channel found.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user