_alpm_recursedeps: free memory on error

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2014-12-24 12:09:26 +10:00
parent 32413213cb
commit be4198b34e
1 changed files with 2 additions and 0 deletions

View File

@ -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);