Skip to content
Snippets Groups Projects
Commit 21d4e924 authored by Natanael Copa's avatar Natanael Copa Committed by Timo Teräs
Browse files

db: fix segfault when --root points to invalid dir

fixes #2134
parent 7086a19f
No related branches found
No related tags found
No related merge requests found
......@@ -1740,7 +1740,9 @@ void apk_db_close(struct apk_database *db)
struct hlist_node *dc, *dn;
int i;
apk_id_cache_free(&db->id_cache);
/* the id cache was never initialized if root_fd failed */
if (db->root_fd >= 0)
apk_id_cache_free(&db->id_cache);
/* Cleaning up the directory tree will cause mode, uid and gid
* of all modified (package providing that directory got removed)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment