summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2017-04-08 18:34:49 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2017-04-08 19:15:37 +1000
commit4f47b63e9c971e6391590caf00a0f2a5ed612e67 (patch)
tree3d9f0ac2e036292ffb0061cf9929ae4d0a35d909
parent25b2d82fe4982edbcb54913f4f5db0a1ae9c726d (diff)
downloadflac-4f47b63e9c971e6391590caf00a0f2a5ed612e67.tar.gz
stream_decoder.c: Fix a memory leak
Leak reported by Secunia Research.
-rw-r--r--src/libFLAC/stream_decoder.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 14d5fe7f..a5527511 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -1753,6 +1753,9 @@ FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__Stre
}
memset (obj->comments[i].entry, 0, obj->comments[i].length) ;
if (!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->comments[i].entry, obj->comments[i].length)) {
+ /* Current i-th entry is bad, so we delete it. */
+ free (obj->comments[i].entry) ;
+ obj->comments[i].entry = NULL ;
obj->num_comments = i;
goto skip;
}