diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-06 15:31:55 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-06 15:31:55 +0200 |
commit | 092bdf3d32d0ee71c04ace21c74ae240bd4ec6ae (patch) | |
tree | eefc3c842ab1af3b75d9827ffd7923a437fe62f1 /src/song.c | |
parent | 6146d4f5bbb800a1499ab23ea8cc997e97d6cb06 (diff) | |
download | mpd-092bdf3d32d0ee71c04ace21c74ae240bd4ec6ae.tar.gz mpd-092bdf3d32d0ee71c04ace21c74ae240bd4ec6ae.tar.xz mpd-092bdf3d32d0ee71c04ace21c74ae240bd4ec6ae.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/song.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/song.c b/src/song.c index 8651a0100..067ce440a 100644 --- a/src/song.c +++ b/src/song.c @@ -202,6 +202,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; |