index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2018-01-07 19:30:42 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-01-10 10:52:26 +1000 |
commit | 2bda849bf9b39b423175d1ee1d8796b856cc9988 (patch) | |
tree | 457191f5eae040c3c37b152fe14dab275ff4c0af /lib/libalpm/be_sync.c | |
parent | 59b6fdeee1722a58d1599bcbd1e2c0fc33debc99 (diff) |
-rw-r--r-- | lib/libalpm/be_sync.c | 5 |
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 429ca4ce..179da561 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -413,7 +413,10 @@ static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname, /* add to the collection */ _alpm_log(db->handle, ALPM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n", pkg->name, db->treename); - db->pkgcache = _alpm_pkghash_add(db->pkgcache, pkg); + if(_alpm_pkghash_add(&db->pkgcache, pkg) == NULL) { + _alpm_pkg_free(pkg); + RET_ERR(db->handle, ALPM_ERR_MEMORY, NULL); + } } else { free(pkgname); free(pkgver); |