Commit 05f01648 authored by Timo Teräs's avatar Timo Teräs

db: fix some (unimportant) memory leaks

parent 36b5cee9
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment