fixed memleak in mpd_set_password
authorAndrew Karpow <andy@ndyk.de>
Fri, 24 Apr 2015 22:39:16 +0000 (00:39 +0200)
committerAndrew Karpow <andy@ndyk.de>
Fri, 24 Apr 2015 22:39:16 +0000 (00:39 +0200)
src/mpd_client.c

index 640b837..ee49c84 100644 (file)
@@ -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);