Code

free info entity while iterating
authorMax Kellermann <max@duempel.org>
Mon, 15 Sep 2008 11:27:33 +0000 (13:27 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 15 Sep 2008 11:27:33 +0000 (13:27 +0200)
Memory leak: the function mpdclient_playlist_update_changes() did not
free the entity which was returned by mpd_getNextInfoEntity().  Add a
mpd_freeInfoEntity() call at the end of each iteration.

src/mpdclient.c

index 57b470681a82832af39143a22c8c8060988202bd..c597411150c1c354b014665898c7176658631c7b 100644 (file)
@@ -753,6 +753,8 @@ mpdclient_playlist_update_changes(mpdclient_t *c)
                        c->playlist.list = g_list_append(c->playlist.list,
                                                         (gpointer)mpd_songDup(song));
                }
+
+               mpd_freeInfoEntity(entity);
        }
 
        /* remove trailing songs */