Skip to content

Commit

Permalink
src/flac.c: Fix another memory leak
Browse files Browse the repository at this point in the history
When the FLAC decoder was passed a malformed file, the associated
`FLAC__StreamDecoder` object was not getting released.

Closes: #233
  • Loading branch information
erikd committed Apr 12, 2017
1 parent fd0484a commit cd7da8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/flac.c
Expand Up @@ -841,7 +841,9 @@ flac_read_header (SF_PRIVATE *psf)

psf_log_printf (psf, "End\n") ;

if (psf->error == 0)
if (psf->error != 0)
FLAC__stream_decoder_delete (pflac->fsd) ;
else
{ FLAC__uint64 position ;

FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
Expand Down

0 comments on commit cd7da8d

Please sign in to comment.