summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f489ffa)
raw | patch | inline | side by side (parent: f489ffa)
author | Max Kellermann <max.kellermann@gmail.com> | |
Fri, 17 Mar 2017 22:18:56 +0000 (23:18 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Fri, 17 Mar 2017 22:23:34 +0000 (23:23 +0100) |
src/mpdclient.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 2ae91b46a1dbc9af56040e9b986a9c4dd0bf67e8..e1aee1cbdb2fcc49d73b82ff13125a3a43f6eb68 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
g_free(c);
}
+static void
+mpdclient_status_free(struct mpdclient *c)
+{
+ if (c->status == NULL)
+ return;
+
+ mpd_status_free(c->status);
+ c->status = NULL;
+}
+
void
mpdclient_disconnect(struct mpdclient *c)
{
}
c->connection = NULL;
- if (c->status)
- mpd_status_free(c->status);
- c->status = NULL;
+ mpdclient_status_free(c);
playlist_clear(&c->playlist);
return false;
/* free the old status */
- if (c->status)
- mpd_status_free(c->status);
+ mpdclient_status_free(c);
/* retrieve new status */
c->status = mpd_run_status(connection);