Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv6757

Modified Files:
        ChangeLog channel.c 
Log Message:
issue #5770


Index: ChangeLog
===================================================================
RCS file: /usr/cvsroot/asterisk/ChangeLog,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- ChangeLog   16 Nov 2005 17:48:18 -0000      1.138
+++ ChangeLog   16 Nov 2005 18:11:28 -0000      1.139
@@ -1,5 +1,7 @@
 2005-11-16  Kevin P. Fleming  <[EMAIL PROTECTED]>
 
+       * channel.c (ast_queue_hangup): ensure that the channel lock is held 
before changing its fields... (issue #5770)
+
        * res/res_musiconhold.c: don't spit out incorrect log messages (and 
leak memory) during reload (issue #5766)
 
        * channels/chan_sip.c (process_sdp): don't pass video codec number into 
ast_getformatname(), it is not valid input for that function (issue #5764)

Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.259
retrieving revision 1.260
diff -u -d -r1.259 -r1.260
--- channel.c   11 Nov 2005 03:48:28 -0000      1.259
+++ channel.c   16 Nov 2005 18:11:28 -0000      1.260
@@ -667,7 +667,11 @@
 int ast_queue_hangup(struct ast_channel *chan)
 {
        struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
-       chan->_softhangup |= AST_SOFTHANGUP_DEV;
+       /* Yeah, let's not change a lock-critical value without locking */
+       if (!ast_mutex_trylock(&chan->lock)) {
+               chan->_softhangup |= AST_SOFTHANGUP_DEV;
+               ast_mutex_unlock(&chan->lock);
+       }
        return ast_queue_frame(chan, &f);
 }
 

_______________________________________________
Asterisk-Cvs mailing list
Asterisk-Cvs@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to