module/mpd: free album/artist/title before replacing them

This commit is contained in:
Daniel Eklöf 2018-12-28 14:14:43 +01:00
parent f2a3deb362
commit 0103eff3a0

View file

@ -214,6 +214,10 @@ update_status(struct module *mod)
const char *title = mpd_song_get_tag(song, MPD_TAG_TITLE, 0); const char *title = mpd_song_get_tag(song, MPD_TAG_TITLE, 0);
mtx_lock(&mod->lock); mtx_lock(&mod->lock);
free(m->album);
free(m->artist);
free(m->title);
m->album = strdup(album); m->album = strdup(album);
m->artist = strdup(artist); m->artist = strdup(artist);
m->title = strdup(title); m->title = strdup(title);