index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Pang Yan Han <pangyanhan@gmail.com> | 2011-02-08 06:59:04 +0800 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-02-07 20:21:34 -0600 |
commit | be9a60a338fd8591918711f5e826012a0d83136e (patch) | |
tree | 9dbbda0e153e6215180e2430bb71e4c1054645e3 /lib/libalpm/be_local.c | |
parent | bb071f4eb20810216b731f6792a32c148eb78931 (diff) |
-rw-r--r-- | lib/libalpm/be_local.c | 4 |
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index c5b24982..58582705 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -393,6 +393,10 @@ static int local_db_populate(pmdb_t *db) /* initialize hash at 50% full */ db->pkgcache = _alpm_pkghash_create(est_count * 2); + if(db->pkgcache == NULL){ + closedir(dbdir); + RET_ERR(PM_ERR_MEMORY, -1); + } while((ent = readdir(dbdir)) != NULL) { const char *name = ent->d_name; |