aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 18:47:21 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 18:47:21 +0100
commita45922cd66cf8a7a03905c020e50ab01dc05cfa9 (patch)
tree2171f4d74886b9d049eafe14dc2b1ce72036c912 /src/tag.c
parent7960ad32fcfb1e17c24d3b26e53a1cdbc5ca0028 (diff)
downloadmpd-a45922cd66cf8a7a03905c020e50ab01dc05cfa9.tar.gz
mpd-a45922cd66cf8a7a03905c020e50ab01dc05cfa9.tar.xz
mpd-a45922cd66cf8a7a03905c020e50ab01dc05cfa9.zip
use g_free() instead of free()
On some platforms, g_free() must be used for memory allocated by GLib. This patch intends to correct a lot of occurrences, but is probably not complete.
Diffstat (limited to 'src/tag.c')
-rw-r--r--src/tag.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/tag.c b/src/tag.c
index 8ac070614..23355c725 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -115,7 +115,7 @@ void tag_lib_init(void)
s++;
}
- free(temp);
+ g_free(temp);
}
struct tag *tag_ape_load(const char *file)
@@ -234,8 +234,7 @@ struct tag *tag_ape_load(const char *file)
fail:
if (fp)
fclose(fp);
- if (buffer)
- free(buffer);
+ g_free(buffer);
return ret;
}
@@ -265,7 +264,7 @@ static void deleteItem(struct tag *tag, int idx)
if (tag->numOfItems > 0) {
tag->items = g_realloc(tag->items, items_size(tag));
} else {
- free(tag->items);
+ g_free(tag->items);
tag->items = NULL;
}
}
@@ -297,11 +296,10 @@ void tag_free(struct tag *tag)
assert(bulk.busy);
bulk.busy = 0;
#endif
- } else if (tag->items) {
- free(tag->items);
- }
+ } else
+ g_free(tag->items);
- free(tag);
+ g_free(tag);
}
struct tag *tag_dup(const struct tag *tag)