From: Max Kellermann Date: Wed, 20 Jul 2011 18:47:23 +0000 (+0200) Subject: mpdclient: fix crash after "clear" command X-Git-Tag: release-0.19~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=90a51a76b88eae5db01a52e2d71e277b2159bb3c;p=ncmpc.git mpdclient: fix crash after "clear" command mpdclient_cmd_clear() calls playlist_clear(), which leaves a freed pointer in c->song. c->song is now cleared, too. --- diff --git a/NEWS b/NEWS index 49693f2..b3cf900 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ncmpc 0.19 - not yet released * require libmpdclient 2.2 * show real server address in status message +* fix crash after "clear" command ncmpc 0.18 - (09/22/2010) diff --git a/src/mpdclient.c b/src/mpdclient.c index 7bf29ea..59b0ad4 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -348,6 +348,7 @@ mpdclient_cmd_clear(struct mpdclient *c) reducing the UI latency */ playlist_clear(&c->playlist); c->playlist.version = mpd_status_get_queue_version(status); + c->song = NULL; } c->events |= MPD_IDLE_QUEUE;