[pacman-dev] [PATCH] _alpm_db_get_pkgcache_hash: check for error when loading pkgcache

Allan McRae allan at archlinux.org
Sun Dec 21 14:33:52 UTC 2014


Signed-off-by: Allan McRae <allan at archlinux.org>
---
 lib/libalpm/db.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 466c96f..11e3a3b 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -542,7 +542,10 @@ alpm_pkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db)
 	}
 
 	if(!(db->status & DB_STATUS_PKGCACHE)) {
-		load_pkgcache(db);
+		if(load_pkgcache(db)) {
+			/* handle->error set in local/sync-db-populate */
+			return NULL;
+		}
 	}
 
 	return db->pkgcache;
-- 
2.2.0


More information about the pacman-dev mailing list