Decrease use count in wav_gsm (bug #2350)
authorMark Spencer <markster@digium.com>
Thu, 2 Sep 2004 03:33:09 +0000 (03:33 +0000)
committerMark Spencer <markster@digium.com>
Thu, 2 Sep 2004 03:33:09 +0000 (03:33 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3706 65c4cc65-6c06-0410-ace0-fbb531ad65f3

formats/format_wav_gsm.c

index f50aa47..9fcc3c9 100755 (executable)
@@ -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 */