diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-17 21:18:35 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-17 21:18:35 +0000 |
commit | b9b89af9a8d97956f895947b8db21710d478ad25 (patch) | |
tree | 332f23a0e6198d67d2ea7b25009362fc8537f83c /channels | |
parent | d9a9a933ddc3318923a4c3029b5d6f22c25ca594 (diff) |
Merged revisions 51197 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r51197 | russell | 2007-01-17 15:17:21 -0600 (Wed, 17 Jan 2007) | 3 lines
Move the check for a failure of ast_channel_alloc() to before locking the
pvt structure again. Otherwise, on a failure, this will cause a deadlock.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51198 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2e7107d13..5b5c6aeb5 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3735,11 +3735,11 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "SIP/%s-%08x", my_name, (int)(long) i); } - ast_mutex_lock(&i->lock); if (!tmp) { ast_log(LOG_WARNING, "Unable to allocate AST channel structure for SIP channel\n"); return NULL; } + ast_mutex_lock(&i->lock); tmp->tech = &sip_tech; /* Select our native format based on codec preference until we receive |