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/db.c | |
parent | 59b6fdeee1722a58d1599bcbd1e2c0fc33debc99 (diff) |
-rw-r--r-- | lib/libalpm/db.c | 5 |
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 789478e8..308fb9c7 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -589,7 +589,10 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg) ? ALPM_PKG_FROM_LOCALDB : ALPM_PKG_FROM_SYNCDB; newpkg->origin_data.db = db; - db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg); + if(_alpm_pkghash_add_sorted(&db->pkgcache, newpkg) == NULL) { + _alpm_pkg_free(newpkg); + RET_ERR(db->handle, ALPM_ERR_MEMORY, -1); + } free_groupcache(db); |