From: Mark Spencer Date: Thu, 2 Sep 2004 03:33:09 +0000 (+0000) Subject: Decrease use count in wav_gsm (bug #2350) X-Git-Tag: 1.0.0~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08a8632ac7c133da9ae3b8ffda90a7b1159d9226;p=thirdparty%2Fasterisk.git Decrease use count in wav_gsm (bug #2350) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3706 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index f50aa47210..9fcc3c9ceb 100755 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -390,6 +390,11 @@ static struct ast_filestream *wav_rewrite(int fd, char *comment) static void wav_close(struct ast_filestream *s) { char zero = 0; + if (ast_mutex_lock(&wav_lock)) { + ast_log(LOG_WARNING, "Unable to lock wav list\n"); + return; + } + glistcnt--; ast_mutex_unlock(&wav_lock); ast_update_use_count(); /* Pad to even length */