afh: Fix a memory leak in stream mode.
authorAndre Noll <maan@systemlinux.org>
Sun, 3 Oct 2010 10:43:00 +0000 (12:43 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 29 Jan 2011 10:43:33 +0000 (11:43 +0100)
We need to free the audio format handler info in both info and stream mode.

afh.c

diff --git a/afh.c b/afh.c
index 5ce6cfc..b5fb65f 100644 (file)
--- a/afh.c
+++ b/afh.c
@@ -192,15 +192,15 @@ int main(int argc, char **argv)
                        print_info(audio_format_num, &afhi);
                        if (conf.chunk_table_given)
                                print_chunk_table(&afhi);
-                       free(afhi.techinfo);
-                       free(afhi.tags.artist);
-                       free(afhi.tags.title);
-                       free(afhi.tags.year);
-                       free(afhi.tags.album);
-                       free(afhi.tags.comment);
-                       free(afhi.chunk_table);
                        printf("\n");
                }
+               free(afhi.techinfo);
+               free(afhi.tags.artist);
+               free(afhi.tags.title);
+               free(afhi.tags.year);
+               free(afhi.tags.album);
+               free(afhi.tags.comment);
+               free(afhi.chunk_table);
                ret2 = para_munmap(audio_file_data, audio_file_size);
                if (ret2 < 0 && ret >= 0)
                        ret = ret2;