From caddebcec0b8753aa876bae387c8c93820a7d9dd Mon Sep 17 00:00:00 2001 From: Andrew Karpow Date: Sat, 25 Apr 2015 00:39:16 +0200 Subject: [PATCH] fixed memleak in mpd_set_password --- src/mpd_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mpd_client.c b/src/mpd_client.c index 640b837..ee49c84 100644 --- a/src/mpd_client.c +++ b/src/mpd_client.c @@ -219,8 +219,9 @@ out_host_change: if(mpd.password) free(mpd.password); - mpd.password = token; + mpd.password = strdup(token); mpd.conn_state = MPD_RECONNECT; + free(p_charbuf); return MG_TRUE; out_set_pass: free(p_charbuf); -- 2.20.1