diff options
author | Max Kellermann <max@duempel.org> | 2008-09-21 22:42:52 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-21 22:42:52 +0200 |
commit | a6df916494891d3dd7ab2262f1c74c6db4604c0c (patch) | |
tree | 24af6b40dbb684e65025ddf2d76de2683bd914e5 /src | |
parent | 85877791beb48d083d7dd8c60d017500cc68496d (diff) | |
download | mpd-a6df916494891d3dd7ab2262f1c74c6db4604c0c.tar.gz mpd-a6df916494891d3dd7ab2262f1c74c6db4604c0c.tar.xz mpd-a6df916494891d3dd7ab2262f1c74c6db4604c0c.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/mpdclient.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mpdclient.c b/src/mpdclient.c index fcdaa4ef4..caa9fe3a9 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; |