summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-12 19:29:14 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-12 19:29:14 +0300
commit05f016481abd851e295f26ad3cb1174a21e93d24 (patch)
tree2aebaa2f24f6a6f7c2dae046f2c22c3afc2ade4c
parent36b5cee98b1e80a493d291e9bffa1ed120ed908a (diff)
downloadapk-tools-05f016481abd851e295f26ad3cb1174a21e93d24.tar.gz
apk-tools-05f016481abd851e295f26ad3cb1174a21e93d24.tar.bz2
apk-tools-05f016481abd851e295f26ad3cb1174a21e93d24.tar.xz
apk-tools-05f016481abd851e295f26ad3cb1174a21e93d24.zip
db: fix some (unimportant) memory leaks
-rw-r--r--src/database.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index 79e9cb3..dfaf343 100644
--- a/src/database.c
+++ b/src/database.c
@@ -63,7 +63,10 @@ static apk_blob_t pkg_name_get_key(apk_hash_item item)
static void pkg_name_free(struct apk_name *name)
{
free(name->name);
- free(name->pkgs);
+ if (name->pkgs)
+ free(name->pkgs);
+ if (name->rdepends)
+ free(name->rdepends);
free(name);
}
@@ -408,6 +411,11 @@ struct apk_package *apk_db_pkg_add(struct apk_database *db, struct apk_package *
idb->filename = pkg->filename;
pkg->filename = NULL;
}
+ if (idb->ipkg == NULL && pkg->ipkg != NULL) {
+ idb->ipkg = pkg->ipkg;
+ idb->ipkg->pkg = idb;
+ pkg->ipkg = NULL;
+ }
apk_pkg_free(pkg);
}
return idb;