From 1534e00236c066336375ac19cd58218f44dc9a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 8 Jul 2019 15:06:24 +0200 Subject: [PATCH] module/mpd: don't try to strdup() NULL strings --- modules/mpd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mpd.c b/modules/mpd.c index d1e88f4..0b56b12 100644 --- a/modules/mpd.c +++ b/modules/mpd.c @@ -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);