[pacman-dev] [PATCH 3/4] _alpm_recursedeps: free memory on error
Allan McRae
allan at archlinux.org
Wed Dec 24 02:14:02 UTC 2014
Signed-off-by: Allan McRae <allan at archlinux.org>
---
lib/libalpm/deps.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index d105a32..2a21443 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, ©)) {
+ /* we return memory on "non-fatal" error in _alpm_pkg_dup */
+ _alpm_pkg_free(copy);
return -1;
}
*targs = alpm_list_add(*targs, copy);
--
2.2.1
More information about the pacman-dev
mailing list