mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
sync_prepare: manually set pm_errno
_alpm_resolvedeps resets pm_errno to 0 by calling alpm_checkdeps. Whenever the last call succeeded, pm_errno was not properly set, preventing pacman from properly handling the error and leaking additional memory. We know pm_errno should be ALPM_ERR_UNSATISFIED_DEPS if resolvedeps has failed, so just set it manually. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
4d68092e2f
commit
fac9ac6c40
@ -442,7 +442,6 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
|||||||
see if they'd like to ignore them rather than failing the sync */
|
see if they'd like to ignore them rather than failing the sync */
|
||||||
if(unresolvable != NULL) {
|
if(unresolvable != NULL) {
|
||||||
int remove_unresolvable = 0;
|
int remove_unresolvable = 0;
|
||||||
alpm_errno_t saved_err = handle->pm_errno;
|
|
||||||
QUESTION(handle, ALPM_QUESTION_REMOVE_PKGS, unresolvable,
|
QUESTION(handle, ALPM_QUESTION_REMOVE_PKGS, unresolvable,
|
||||||
NULL, NULL, &remove_unresolvable);
|
NULL, NULL, &remove_unresolvable);
|
||||||
if(remove_unresolvable) {
|
if(remove_unresolvable) {
|
||||||
@ -458,7 +457,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* pm_errno was set by resolvedeps, callback may have overwrote it */
|
/* pm_errno was set by resolvedeps, callback may have overwrote it */
|
||||||
handle->pm_errno = saved_err;
|
handle->pm_errno = ALPM_ERR_UNSATISFIED_DEPS;
|
||||||
alpm_list_free(resolved);
|
alpm_list_free(resolved);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user