aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_monitor.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-22 14:47:21 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-22 14:47:21 +0000
commit8f813d432c685f0b0c25e98261379b083263cf32 (patch)
tree4ae9c933bdbed5f683e5126fac32e00c78d4af3a /res/res_monitor.c
parent7ceaf8171a8991f78e19f492420ce3a32c84ca1b (diff)
Fix potential deadlocks in res_monitor
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3272 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_monitor.c')
-rwxr-xr-xres/res_monitor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c
index 43b6d728e..24485a787 100755
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -386,6 +386,7 @@ static int start_monitor_action(struct mansession *s, struct message *m)
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 @@ static int change_monitor_action(struct mansession *s, struct message *m)
}
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;
}