]> git.tue.mpg.de Git - paraslash.git/commitdiff
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 5ce6cfc5a13c383030fe10c240eba8468add021c..b5fb65fc418a6e4a3febef87cdce6d630b81cfb3 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;