summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1e23bad)
raw | patch | inline | side by side (parent: 1e23bad)
author | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:42:51 +0000 (22:42 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:42:51 +0000 (22:42 +0200) |
During authentication, the message pointer was allocated, but never
freed. Allocate it only if it is really used (and freed).
freed. Allocate it only if it is really used (and freed).
src/mpdclient.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index c15c34d6dce5924cf0029716eefff654ecb7fbdd..fcdaa4ef452c0923d36d56ad235cc47ce6e0e36a 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
mpd_finishCommand(c->connection);
if (c->connection->error) {
- gchar *msg = locale_to_utf8(c->connection->errorStr);
gint error = c->connection->error;
-
- if (error == MPD_ERROR_ACK)
- error = error | (c->connection->errorCode << 8);
+ gchar *msg;
if (c->connection->errorCode == MPD_ACK_ERROR_PERMISSION &&
screen_auth(c) == 0)
return 0;
+ if (error == MPD_ERROR_ACK)
+ error = error | (c->connection->errorCode << 8);
+
+ msg = locale_to_utf8(c->connection->errorStr);
error_cb(c, error, msg);
g_free(msg);
return error;