From cdc9bb460e9536577d2747d51c76306a91b3d064 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 3 Sep 2008 02:14:52 -0700 Subject: tag: fix segfault on update clearMpdTag could be called on a tag that was still in a tag_begin_add transaction before tag_end_add is called. This was causing free() to attempt to operate on bulk.items; which is un-free()-able. Now instead we unmark the bulk.busy to avoid committing the tags to the heap only to be immediately freed. Additionally, we need to remember to call tag_end_add() when a song is updated before we NULL song->tag to avoid tripping an assertion the next time tag_begin_add() is called. --- src/song.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/song.c') diff --git a/src/song.c b/src/song.c index 063b0a7b6..9b8b7d4db 100644 --- a/src/song.c +++ b/src/song.c @@ -201,6 +201,7 @@ static void insertSongIntoList(SongList * list, ListNode ** nextSongNode, Song *tempSong = (Song *) ((*nextSongNode)->data); if (tempSong->mtime != song->mtime) { tag_free(tempSong->tag); + tag_end_add(song->tag); tempSong->tag = song->tag; tempSong->mtime = song->mtime; song->tag = NULL; -- cgit v1.2.3