From: Andrew Karpow Date: Fri, 24 Apr 2015 22:39:16 +0000 (+0200) Subject: fixed memleak in mpd_set_password X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=caddebcec0b8753aa876bae387c8c93820a7d9dd;p=ympd.git fixed memleak in mpd_set_password --- 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);