From: Max Kellermann Date: Wed, 30 Sep 2009 20:13:06 +0000 (+0200) Subject: mpdclient: check to assertion in mpdclient_cmd_add() X-Git-Tag: release-0.16~248 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6e65ea8342eba9f910ea94358116e6c9bc6b5cb9;p=ncmpc.git mpdclient: check to assertion in mpdclient_cmd_add() It's illegal to pass song=NULL. --- diff --git a/src/mpdclient.c b/src/mpdclient.c index e718cd9..d95e278 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -402,10 +402,10 @@ mpdclient_cmd_add(struct mpdclient *c, const struct mpd_song *song) { gint retval = 0; - if (MPD_ERROR(c)) - return -1; + assert(c != NULL); + assert(song != NULL); - if (song == NULL) + if (MPD_ERROR(c)) return -1; /* send the add command to mpd */