--- asterisk-11.2.1/channels/chan_unistim.c 2012-10-15 01:11:45.000000000 -0700 +++ asterisk-11.2.1-custom/channels/chan_unistim.c 2013-02-06 17:00:43.000000000 -0800 @@ -4641,6 +4641,7 @@ ast_mutex_lock(&sub->parent->parent->lock); if (!sub->parent->parent->session) { ast_log(LOG_WARNING, "Unistim callback function called without a session\n"); + ast_mutex_unlock(&sub->parent->parent->lock); return NULL; } ast_mutex_unlock(&sub->parent->parent->lock); @@ -5074,6 +5075,7 @@ if (p->owner != oldchan) { ast_log(LOG_WARNING, "old channel wasn't %s (%p) but was %s (%p)\n", ast_channel_name(oldchan), oldchan, ast_channel_name(p->owner), p->owner); + ast_mutex_unlock(&p->lock); return -1; }