diff src/audacious/playlist.c @ 4105:0d300e0b0001

Fixes memory leak in playlist_entry_get_info() due not freeing probe result (Bugzilla #38)
author Jussi Judin <jjudin+audacious@iki.fi>
date Mon, 24 Dec 2007 23:05:10 -0600
parents e1ecacef3789
children d5d4590cb7d2
line wrap: on
line diff
--- a/src/audacious/playlist.c	Wed Dec 19 00:57:45 2007 -0600
+++ b/src/audacious/playlist.c	Mon Dec 24 23:05:10 2007 -0600
@@ -227,9 +227,10 @@
 
     /* renew tuple if file mtime is newer than tuple mtime. */
     if (entry->tuple){
-        if (tuple_get_int(entry->tuple, FIELD_MTIME, NULL) == modtime)
+        if (tuple_get_int(entry->tuple, FIELD_MTIME, NULL) == modtime) {
+            g_free(pr);
             return TRUE;
-        else {
+        } else {
             mowgli_object_unref(entry->tuple);
             entry->tuple = NULL;
         }
@@ -240,8 +241,10 @@
     else if (entry->decoder != NULL && entry->decoder->get_song_tuple != NULL)
         tuple = entry->decoder->get_song_tuple(entry->filename);
 
-    if (tuple == NULL)
+    if (tuple == NULL) {
+        g_free(pr);
         return FALSE;
+    }
 
     /* attach mtime */
     tuple_associate_int(tuple, FIELD_MTIME, NULL, modtime);