changeset 2287:2421c87fb855

Fix memory leak in mad plugin when changing songs and writing output. (Bugzilla #82)
author Jussi Judin <jjudin+audacious@iki.fi>
date Wed, 09 Jan 2008 09:25:48 -0600
parents 4f84615468b7
children 5a925593d754 854b5fae995e
files src/madplug/decoder.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/madplug/decoder.c	Wed Jan 09 09:24:30 2008 -0600
+++ b/src/madplug/decoder.c	Wed Jan 09 09:25:48 2008 -0600
@@ -153,12 +153,12 @@
         }
     }
     assert(pos == olen);
-    if (!info->playback->playing)
+    if (!info->playback->playing) {
+        g_free(output);
         return;
+    }
     info->playback->pass_audio(info->playback,
                   FMT_S16_LE, MAD_NCHANNELS(header), olen, output, &(info->playback->playing));
-    if (!info->playback->playing)
-        return;
     g_free(output);
 }