From 7d9316a52d935ce6c9f4ae3030c975d660a02db6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 28 Apr 2009 19:57:49 +0200 Subject: 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(). --- src/tag.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tag.c') diff --git a/src/tag.c b/src/tag.c index a75ef6ba5..34205d20d 100644 --- a/src/tag.c +++ b/src/tag.c @@ -163,6 +163,8 @@ void tag_free(struct tag *tag) { int i; + assert(tag != NULL); + g_mutex_lock(tag_pool_lock); for (i = tag->num_items; --i >= 0; ) tag_pool_put_item(tag->items[i]); -- cgit v1.2.3