From: Tilghman Lesher Date: Wed, 26 Jul 2006 17:43:17 +0000 (+0000) Subject: Only unlock these if they were locked on entry X-Git-Tag: 1.4.0-beta1~517 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a60a9b6637a4b0e5f70f53491d8d994c56bb5e7d;p=thirdparty%2Fasterisk.git Only unlock these if they were locked on entry git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38250 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_monitor.c b/res/res_monitor.c index 87f2c4dc4c..8340a6a598 100644 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -200,7 +200,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec, ast_log(LOG_WARNING, "Could not create file %s\n", monitor->read_filename); free(monitor); - ast_channel_unlock(chan); + UNLOCK_IF_NEEDED(chan, need_lock); return -1; } if (ast_fileexists(monitor->write_filename, NULL, NULL) > 0) { @@ -213,7 +213,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec, monitor->write_filename); ast_closestream(monitor->read_stream); free(monitor); - ast_channel_unlock(chan); + UNLOCK_IF_NEEDED(chan, need_lock); return -1; } chan->monitor = monitor;