Skip to content

Commit

Permalink
Free metadata if subsequent allocation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Oct 7, 2024
1 parent 86d6de6 commit d0895e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/flac/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,7 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio
}
if(!static_metadata_append(&static_metadata, p, /*needs_delete=*/true)) {
flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for foreign metadata block\n", e->inbasefilename);
FLAC__metadata_object_delete(p);
static_metadata_clear(&static_metadata);
return false;
}
Expand Down

0 comments on commit d0895e9

Please sign in to comment.