]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Remove an extraneous unlocking operation from ast_channel_free.
authorMark Michelson <mmichelson@digium.com>
Wed, 13 May 2009 19:41:44 +0000 (19:41 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 13 May 2009 19:41:44 +0000 (19:41 +0000)
In the case that we could not remove the desired channel from the
list of channels, there was an extra call to unlock the channel list.
Since we unlock the list later on in the function anyway, this results
in the list being unlocked twice yet only being locked once.

(closes issue #15098)
Reported by: tim_ringenbach
Patches:
      remove_extra_unlock.diff uploaded by tim (license 540)

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

main/channel.c

index 6683d2b915746428cbecfbea776b50e6a65f41db..74929dcbbd69439eef8e3f0e55b803f6138eaf54 100644 (file)
@@ -1225,7 +1225,6 @@ void ast_channel_free(struct ast_channel *chan)
        
        AST_LIST_LOCK(&channels);
        if (!AST_LIST_REMOVE(&channels, chan, chan_list)) {
-               AST_LIST_UNLOCK(&channels);
                ast_log(LOG_ERROR, "Unable to find channel in list to free. Assuming it has already been done.\n");
        }
        /* Lock and unlock the channel just to be sure nobody has it locked still