Code

screen_song: free the song pointer
authorMax Kellermann <max@duempel.org>
Tue, 18 Nov 2008 23:06:46 +0000 (00:06 +0100)
committerMax Kellermann <max@duempel.org>
Tue, 18 Nov 2008 23:06:46 +0000 (00:06 +0100)
Fix a memory leak.

src/screen_song.c

index 7dd9b579830f1954bbbfccc5533b2a50ab1cf2e6..202025ee81d357899d7c589c6bebd2c6f28d49cb 100644 (file)
@@ -35,6 +35,11 @@ screen_song_clear(void)
                g_free(g_ptr_array_index(current.lines, i));
 
        g_ptr_array_set_size(current.lines, 0);
+
+       if (current.song != NULL) {
+               mpd_freeSong(current.song);
+               current.song = NULL;
+       }
 }
 
 static void