From: Max Kellermann Date: Wed, 17 Sep 2008 05:21:30 +0000 (+0200) Subject: mpdclient: call playlist_clear() in mpdclient_playlist_update() X-Git-Tag: v0.12_alpha1~284 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5fb495639feb4d6789cfc95358fd5ffd95bd871a;p=ncmpc.git mpdclient: call playlist_clear() in mpdclient_playlist_update() Instead of freeing the playlist with mpdclient_playlist_free(), call playlist_clear() to empty the song list. This fixes a segmentation fault which occured when you cleared the playlist. --- diff --git a/src/mpdclient.c b/src/mpdclient.c index 7c2cd32..58a3e8f 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -652,8 +652,7 @@ mpdclient_playlist_update(mpdclient_t *c) if (MPD_ERROR(c)) return -1; - if (c->playlist.list) - mpdclient_playlist_free(&c->playlist); + playlist_clear(&c->playlist); mpd_sendPlaylistInfoCommand(c->connection,-1); while ((entity = mpd_getNextInfoEntity(c->connection))) {