summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8587779)
raw | patch | inline | side by side (parent: 8587779)
author | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:42:52 +0000 (22:42 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:42:52 +0000 (22:42 +0200) |
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.
not MPD_ERROR_ACK. Read it only if MPD_ERROR_ACK is set, to make
valgrind happy.
src/mpdclient.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index fcdaa4ef452c0923d36d56ad235cc47ce6e0e36a..caa9fe3a951eafe0a3467d2a65798cec3557b297 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.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;