summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/deps.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2014-12-24 03:09:26 +0100
committerAllan McRae <allan@archlinux.org>2014-12-27 08:08:32 +0100
commitbe4198b34e01242e481664776c51936a150c1ff8 (patch)
treedc2b7d1501c92dbc1cf91ad6d118b4bc5ad882aa /lib/libalpm/deps.c
parent32413213cb3aa532f64bd19024f9694a22875e21 (diff)
downloadpacman-be4198b34e01242e481664776c51936a150c1ff8.tar.gz
pacman-be4198b34e01242e481664776c51936a150c1ff8.tar.xz
_alpm_recursedeps: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r--lib/libalpm/deps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index d105a324..2a21443e 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -614,6 +614,8 @@ int _alpm_recursedeps(alpm_db_t *db, alpm_list_t **targs, int include_explicit)
deppkg->name);
/* add it to the target list */
if(_alpm_pkg_dup(deppkg, &copy)) {
+ /* we return memory on "non-fatal" error in _alpm_pkg_dup */
+ _alpm_pkg_free(copy);
return -1;
}
*targs = alpm_list_add(*targs, copy);