summaryrefslogtreecommitdiffstats
path: root/src/hash.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-01-06 20:30:22 +0200
committerTimo Teras <timo.teras@iki.fi>2009-01-06 21:23:26 +0200
commit0314104d93b831f53a9ab21622ba61aa49b7cccd (patch)
tree765232ec3cd7a150cf3af46b425f43fdaf83dfc8 /src/hash.c
parent5e2aca267883a03dae8193eda9328a48b187fe84 (diff)
downloadapk-tools-0314104d93b831f53a9ab21622ba61aa49b7cccd.tar.bz2
apk-tools-0314104d93b831f53a9ab21622ba61aa49b7cccd.tar.xz
db, pkg: fix rest of memory leaks
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index b4bbc90..9260b9b 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -35,7 +35,7 @@ int apk_hash_foreach(struct apk_hash *h, apk_hash_enumerator_f e, void *ctx)
for (i = 0; i < h->buckets->num; i++) {
hlist_for_each_safe(pos, n, &h->buckets->item[i]) {
r = e(((void *) pos) - offset, ctx);
- if (r != 0)
+ if (r != 0 && ctx != NULL)
return r;
}
}