fixes an error in r203638 CEL commit
authorDavid Vossel <dvossel@digium.com>
Fri, 17 Jul 2009 22:07:36 +0000 (22:07 +0000)
committerDavid Vossel <dvossel@digium.com>
Fri, 17 Jul 2009 22:07:36 +0000 (22:07 +0000)
(closes issue #15525)
Reported by: elguero
Patches:
      iax2-double-unlock.patch uploaded by elguero (license 37)
      15525.diff uploaded by dvossel (license 671)
Tested by: dvossel

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

channels/chan_iax2.c

index 07883f3..d0f5952 100644 (file)
@@ -8523,8 +8523,7 @@ static void set_hangup_source_and_cause(int callno, unsigned char causecode)
        do {
                if (ast_channel_trylock(iaxs[callno]->owner)) {
                        DEADLOCK_AVOIDANCE(&iaxsl[callno]);
-               }
-               else {
+               } else {
                        locked = 1;
                        owner = iaxs[callno]->owner;
                }
@@ -8537,13 +8536,11 @@ static void set_hangup_source_and_cause(int callno, unsigned char causecode)
                }
                ast_set_hangupsource(iaxs[callno]->owner, iaxs[callno]->owner->name, 0);
                ast_channel_unlock(owner);
-       }
-       if (locked) {
+       } else if(locked) {
                ast_channel_unlock(owner);
        }
 }
 
-
 static int socket_process(struct iax2_thread *thread)
 {
        struct sockaddr_in sin;