[Asterisk-cvs] asterisk/res res_monitor.c,1.17,1.18

markster at lists.digium.com markster at lists.digium.com
Tue Jun 22 11:01:26 CDT 2004


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

Modified Files:
	res_monitor.c 
Log Message:
Fix potential deadlocks in res_monitor


Index: res_monitor.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_monitor.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- res_monitor.c	9 Jun 2004 01:45:08 -0000	1.17
+++ res_monitor.c	22 Jun 2004 14:47:21 -0000	1.18
@@ -386,6 +386,7 @@
 	if( ast_monitor_start( c, format, fname, 1 ) ) {
 		if( ast_monitor_change_fname( c, fname, 1 ) ) {
 			astman_send_error(s, m, "Could not start monitoring channel");
+			ast_mutex_unlock(&c->lock);
 			return 0;
 		}
 	}
@@ -457,8 +458,10 @@
 	}
 	if( ast_monitor_change_fname( c, fname, 1 ) ) {
 		astman_send_error(s, m, "Could not change monitored filename of channel");
+		ast_mutex_unlock(&c->lock);
 		return 0;
 	}
+	ast_mutex_unlock(&c->lock);
 	astman_send_ack(s, m, "Stopped monitoring channel");
 	return 0;
 }




More information about the svn-commits mailing list