mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
stream_decoder.c: Fix a memory leak
Leak reported by Secunia Research.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user