module/mpd: don't try to strdup() NULL strings

This commit is contained in:
Daniel Eklöf 2019-07-08 15:06:24 +02:00
parent 9b5dca52e2
commit 1534e00236
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -353,9 +353,9 @@ update_status(struct module *mod)
free(m->artist);
free(m->title);
m->album = strdup(album);
m->artist = strdup(artist);
m->title = strdup(title);
m->album = album != NULL ? strdup(album) : NULL;
m->artist = artist != NULL ? strdup(artist) : NULL;
m->title = title != NULL ? strdup(title) : NULL;
mtx_unlock(&mod->lock);
mpd_song_free(song);