From 952c93b2d71c2172d7df8e0d6a9321eeb68cb37a Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sun, 9 Apr 2017 15:17:06 +1000 Subject: [PATCH] metaflac: Fix a memory leak --- src/metaflac/operations.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 119d4974..952f1d60 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -286,7 +286,8 @@ FLAC__bool do_shorthand_operations_on_file(const char *filename, const CommandLi if(!FLAC__metadata_chain_read(chain, filename)) { print_error_with_chain_status(chain, "%s: ERROR: reading metadata", filename); - return false; + ok = false; + goto cleanup; } for(i = 0; i < options->ops.num_operations && ok; i++) { @@ -325,6 +326,7 @@ FLAC__bool do_shorthand_operations_on_file(const char *filename, const CommandLi print_error_with_chain_status(chain, "%s: ERROR: writing FLAC file", filename); } + cleanup : FLAC__metadata_chain_delete(chain); return ok; -- GitLab