1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 07:48:50 -05:00

_alpm_db_add_pkgincache: free potential memory leak

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2014-12-24 12:26:39 +10:00
parent 60d958c78b
commit 2f0ca00e55

View File

@ -572,6 +572,8 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg)
}
if(_alpm_pkg_dup(pkg, &newpkg)) {
/* we return memory on "non-fatal" error in _alpm_pkg_dup */
_alpm_pkg_free(newpkg);
return -1;
}