]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Only write to wav files that were opened to be written to.
authorSean Bright <sean@malleable.com>
Fri, 29 Jul 2011 16:58:08 +0000 (16:58 +0000)
committerSean Bright <sean@malleable.com>
Fri, 29 Jul 2011 16:58:08 +0000 (16:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330203 65c4cc65-6c06-0410-ace0-fbb531ad65f3

formats/format_wav.c

index f8f8a9cf549866dafec7be6eced5e45e277ce998..023cd4037689e387319b66a1a8a8eccd69f0b7da 100644 (file)
@@ -340,6 +340,10 @@ static void wav_close(struct ast_filestream *s)
        char zero = 0;
        struct wav_desc *fs = (struct wav_desc *)s->_private;
 
+       if ((s->mode & O_RDONLY) == O_RDONLY) {
+               return;
+       }
+
        if (s->filename) {
                update_header(s->f);
        }