Fix locks that are held too long
authorMark Spencer <markster@digium.com>
Mon, 22 Mar 2004 22:48:59 +0000 (22:48 +0000)
committerMark Spencer <markster@digium.com>
Mon, 22 Mar 2004 22:48:59 +0000 (22:48 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2527 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 9d68097..cf86036 100755 (executable)
@@ -2325,8 +2325,11 @@ static int zt_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags,
        oi2 = zt_get_index(c1, p1, 0);
        oc1 = p0->owner;
        oc2 = p1->owner;
        oi2 = zt_get_index(c1, p1, 0);
        oc1 = p0->owner;
        oc2 = p1->owner;
-       if ((oi1 < 0) || (oi2 < 0))
+       if ((oi1 < 0) || (oi2 < 0)) {
+               ast_mutex_unlock(&c0->lock);
+               ast_mutex_unlock(&c1->lock);
                return -1;
                return -1;
+       }