From 6e65ea8342eba9f910ea94358116e6c9bc6b5cb9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 22:13:06 +0200 Subject: [PATCH] mpdclient: check to assertion in mpdclient_cmd_add() It's illegal to pass song=NULL. --- src/mpdclient.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 */ -- 2.30.2