]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix several unreleased mutex locks that cause problem with processing calls
authorIgor Goncharovskiy <igor.goncharovsky@gmail.com>
Tue, 5 Mar 2013 03:51:48 +0000 (03:51 +0000)
committerIgor Goncharovskiy <igor.goncharovsky@gmail.com>
Tue, 5 Mar 2013 03:51:48 +0000 (03:51 +0000)
(Closes issue ASTERISK-21119)
Reported by: Daniel Bohling
Tested by: Daniel Bohling

........

Merged revisions 382409 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@382410 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_unistim.c

index ac4daa68dad3bc564dcc29f0ef20cca57da6ecf7..abe6bdab1dd97298bf5645c2599fa20825ba68b5 100644 (file)
@@ -4645,6 +4645,7 @@ static struct unistimsession *channel_to_session(struct ast_channel *ast)
        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);
@@ -5078,6 +5079,7 @@ static int unistim_fixup(struct ast_channel *oldchan, struct ast_channel *newcha
        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;
        }