diff options
author | Max Kellermann <max@duempel.org> | 2008-09-17 07:21:30 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-17 07:21:30 +0200 |
commit | 5fb495639feb4d6789cfc95358fd5ffd95bd871a (patch) | |
tree | 0c690ae9b7276325527665049312e469e3d08bdf /src/mpdclient.c | |
parent | ba041d04c209850ef7cd42077c392d6e54bb235f (diff) | |
download | mpd-5fb495639feb4d6789cfc95358fd5ffd95bd871a.tar.gz mpd-5fb495639feb4d6789cfc95358fd5ffd95bd871a.tar.xz mpd-5fb495639feb4d6789cfc95358fd5ffd95bd871a.zip |
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.
Diffstat (limited to 'src/mpdclient.c')
-rw-r--r-- | src/mpdclient.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mpdclient.c b/src/mpdclient.c index 7c2cd32f7..58a3e8fb7 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))) { |