diff options
-rw-r--r-- | src/database.c | 10 |
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; |