summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 6c30c948..e3e7fa90 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -558,8 +558,12 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
for(j = spkg->removes; j; j = j->next) {
alpm_pkg_t *rpkg = j->data;
if(!_alpm_pkg_find(trans->remove, rpkg->name)) {
+ alpm_pkg_t *copy;
_alpm_log(handle, ALPM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name);
- trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(rpkg));
+ if(_alpm_pkg_dup(rpkg, &copy) == -1) {
+ return -1;
+ }
+ trans->remove = alpm_list_add(trans->remove, copy);
}
}
}