Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r--lib/libalpm/db.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 466c96f1..0ca12d70 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -331,7 +331,7 @@ alpm_db_t *_alpm_db_new(const char *treename, int is_local)
alpm_db_t *db;
CALLOC(db, 1, sizeof(alpm_db_t), return NULL);
- STRDUP(db->treename, treename, return NULL);
+ STRDUP(db->treename, treename, FREE(db); return NULL);
if(is_local) {
db->status |= DB_STATUS_LOCAL;
} else {
@@ -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;