summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-06-12 10:32:54 +0300
committerTimo Teräs <timo.teras@iki.fi>2015-06-12 10:32:54 +0300
commit3e8e2b562226fa10adb98b1c5faba4b547c4d139 (patch)
tree62219aee500808f46910b9840dbc4815c642bdb2 /src
parentc4295e9cf8132588c84b1f4e5907b023cbc7a8f6 (diff)
downloadapk-tools-3e8e2b562226fa10adb98b1c5faba4b547c4d139.tar.gz
apk-tools-3e8e2b562226fa10adb98b1c5faba4b547c4d139.tar.bz2
apk-tools-3e8e2b562226fa10adb98b1c5faba4b547c4d139.tar.xz
apk-tools-3e8e2b562226fa10adb98b1c5faba4b547c4d139.zip
free atoms when VALGRIND is defined
Diffstat (limited to 'src')
-rw-r--r--src/blob.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c
index e4ca825..46e5732 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -662,8 +662,18 @@ static struct apk_hash_ops atom_ops = {
apk_blob_t apk_null_blob = {0,0};
+#ifdef VALGRIND
+static void apk_atom_fini(void)
+{
+ apk_hash_free(&atom_hash);
+}
+#endif
+
void apk_atom_init(void)
{
+#ifdef VALGRIND
+ atexit(apk_atom_fini);
+#endif
apk_hash_init(&atom_hash, &atom_ops, 10000);
}