aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/screen_utils.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 308d049f4..ff3fffa44 100644
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
@@ -121,10 +121,19 @@ screen_read_password(WINDOW *w, const char *prompt)
static gint
_screen_auth(struct mpdclient *c, gint recursion)
{
+ char *password;
+
mpd_clearError(c->connection);
if (recursion > 2)
return 1;
- mpd_sendPasswordCommand(c->connection, screen_read_password(NULL, NULL));
+
+ password = screen_read_password(NULL, NULL);
+ if (password == NULL)
+ return 1;
+
+ mpd_sendPasswordCommand(c->connection, password);
+ g_free(password);
+
mpd_finishCommand(c->connection);
mpdclient_update(c);
if (c->connection->errorCode == MPD_ACK_ERROR_PASSWORD)