song_save: don't call tag_free(NULL)
When a song was in the database twice (which shouldn't happen), and the first song had no tag items, MPD calledd tag_free(NULL). Add a check to that source location, and an assertion to tag_free().
This commit is contained in:
parent
fd09a3cf1f
commit
7d9316a52d
@ -80,7 +80,8 @@ insertSongIntoList(struct songvec *sv, struct song *newsong)
|
||||
tag_end_add(newsong->tag);
|
||||
} else { /* prevent dupes, just update the existing song info */
|
||||
if (existing->mtime != newsong->mtime) {
|
||||
tag_free(existing->tag);
|
||||
if (existing->tag != NULL)
|
||||
tag_free(existing->tag);
|
||||
if (newsong->tag)
|
||||
tag_end_add(newsong->tag);
|
||||
existing->tag = newsong->tag;
|
||||
|
Loading…
Reference in New Issue
Block a user