[asterisk-bugs] [Asterisk 0015098]: [patch] ast_channel_free might double unlock channels lock

Asterisk Bug Tracker noreply at bugs.digium.com
Wed May 13 14:41:50 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15098 
====================================================================== 
Reported By:                tim_ringenbach
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   15098
Category:                   Channels/General
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.24 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-05-13 12:54 CDT
Last Modified:              2009-05-13 14:41 CDT
====================================================================== 
Summary:                    [patch] ast_channel_free might double unlock
channels lock
Description: 
ast_channel_free() might unlock the channels lock twice, once in the "if
(!AST_LIST_REMOVE(&channels, chan, chan_list))" block and once more at the
end.

I haven't actually run into this happening in the wild (that I know of
anyway), I just noticed it in the code.
====================================================================== 

---------------------------------------------------------------------- 
 (0104701) svnbot (reporter) - 2009-05-13 14:41
 https://issues.asterisk.org/view.php?id=15098#c104701 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 194356

U   branches/1.4/main/channel.c

------------------------------------------------------------------------
r194356 | mmichelson | 2009-05-13 14:41:49 -0500 (Wed, 13 May 2009) | 13
lines

Remove an extraneous unlocking operation from ast_channel_free.

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 https://issues.asterisk.org/view.php?id=15098)
Reported by: tim_ringenbach
Patches:
      remove_extra_unlock.diff uploaded by tim (license 540)


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=194356 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-13 14:41 svnbot         Checkin                                      
2009-05-13 14:41 svnbot         Note Added: 0104701                          
======================================================================




More information about the asterisk-bugs mailing list