Skip to content

Commit cd7da8d

Browse files
committed
src/flac.c: Fix another memory leak
When the FLAC decoder was passed a malformed file, the associated `FLAC__StreamDecoder` object was not getting released. Closes: libsndfile#233
1 parent fd0484a commit cd7da8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/flac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,9 @@ flac_read_header (SF_PRIVATE *psf)
841841

842842
psf_log_printf (psf, "End\n") ;
843843

844-
if (psf->error == 0)
844+
if (psf->error != 0)
845+
FLAC__stream_decoder_delete (pflac->fsd) ;
846+
else
845847
{ FLAC__uint64 position ;
846848

847849
FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;

0 commit comments

Comments
 (0)