[flac-dev] [PATCH] for potential memory leaks
lvqcl.mail at gmail.com
Sat Aug 22 03:23:25 PDT 2015
Erik de Castro Lopo wrote:
> Working on a fix for this and re-visiting some of this realloc()
I noticed that your patch removes the call to vorbiscomment_entry_array_delete_()
in FLAC__metadata_object_vorbiscomment_resize_comments() function, and I think
that it reintroduces one place of a potential memory leak:
'object->data.vorbis_comment.comments' is a pointer to an array of
FLAC__StreamMetadata_VorbisComment_Entry structs, and these structs contain pointers.
So it's necessary to free all 'object->data.vorbis_comment.comments[i].entry' pointers
before freeing 'object->data.vorbis_comment.comments' pointer itself.
More information about the flac-dev