From a6df916494891d3dd7ab2262f1c74c6db4604c0c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 21 Sep 2008 22:42:52 +0200 Subject: [PATCH] mpdclient: check errorCode only if MPD_ERROR_ACK is set connection->errorCode has an undefined value when connection->error is not MPD_ERROR_ACK. Read it only if MPD_ERROR_ACK is set, to make valgrind happy. --- src/mpdclient.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mpdclient.c b/src/mpdclient.c index fcdaa4e..caa9fe3 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -126,7 +126,8 @@ mpdclient_finish_command(mpdclient_t *c) gint error = c->connection->error; gchar *msg; - if (c->connection->errorCode == MPD_ACK_ERROR_PERMISSION && + if (error == MPD_ERROR_ACK && + c->connection->errorCode == MPD_ACK_ERROR_PERMISSION && screen_auth(c) == 0) return 0; -- 2.30.2