diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-04-09 15:17:06 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-04-09 15:17:06 +1000 |
commit | 952c93b2d71c2172d7df8e0d6a9321eeb68cb37a (patch) | |
tree | 56de9c7d0a2e4e0bb2f6e45eea5c078a2b261444 | |
parent | 4f47b63e9c971e6391590caf00a0f2a5ed612e67 (diff) | |
download | flac-952c93b2d71c2172d7df8e0d6a9321eeb68cb37a.tar.gz |
metaflac: Fix a memory leak
-rw-r--r-- | src/metaflac/operations.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |