summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/db.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 0ca12d70..bfc80ac8 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -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;
}