for completeness free all arrays before exit

so valgrind does not report any leaks
cute-signatures
Timo Teräs 2015-06-12 10:16:34 +03:00
parent 6b140ec5c7
commit c4295e9cf8
2 changed files with 2 additions and 0 deletions

View File

@ -258,6 +258,7 @@ void apk_db_dir_unref(struct apk_database *db, struct apk_db_dir *dir, int rmdir
{ {
if (--dir->refs > 0) return; if (--dir->refs > 0) return;
db->installed.stats.dirs--; db->installed.stats.dirs--;
apk_protected_path_array_free(&dir->protected_paths);
if (dir->namelen == 0) return; if (dir->namelen == 0) return;
if (rmdir_mode == APK_DIR_REMOVE && !(apk_flags & APK_SIMULATE)) if (rmdir_mode == APK_DIR_REMOVE && !(apk_flags & APK_SIMULATE))

View File

@ -940,6 +940,7 @@ void apk_pkg_free(struct apk_package *pkg)
apk_pkg_uninstall(NULL, pkg); apk_pkg_uninstall(NULL, pkg);
apk_dependency_array_free(&pkg->depends); apk_dependency_array_free(&pkg->depends);
apk_dependency_array_free(&pkg->provides);
apk_dependency_array_free(&pkg->install_if); apk_dependency_array_free(&pkg->install_if);
if (pkg->url) if (pkg->url)
free(pkg->url); free(pkg->url);