forked from external/yambar
module/mpd: don't try to strdup() NULL strings
This commit is contained in:
parent
9b5dca52e2
commit
1534e00236
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue