From 6be08f76f6c4188f0aa4d0a4d88595a898bf3d3b Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 6 Jan 2014 11:52:22 -0500 Subject: local_db_populate: initialize empty pkgcache If the db directory did not exist when local_db_populate was called, the pkgcache wouldn't be initialized, causing pkghash_add_pkg to fail. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/be_local.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index d6a7b3c0..0b5b266f 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -459,6 +459,7 @@ static int local_db_populate(alpm_db_t *db) /* no database existing yet is not an error */ db->status &= ~DB_STATUS_EXISTS; db->status |= DB_STATUS_MISSING; + db->pkgcache = _alpm_pkghash_create(0); return 0; } RET_ERR(db->handle, ALPM_ERR_DB_OPEN, -1); -- cgit v1.2.3-70-g09d2