summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormorganamilo <morganamilo@archlinux.org>2020-01-23 07:38:35 +0100
committerAndrew Gregory <andrew@archlinux.org>2020-06-18 10:44:01 +0200
commit08aa3d97ea3823f2919e7d66041438db9e7488a0 (patch)
tree08c2c34d39ef4a163153a089c2c009b117f89ca5
parent0bf4779cda35cfb8dc049ec5f27017c65c8ce716 (diff)
downloadpacman-08aa3d97ea3823f2919e7d66041438db9e7488a0.tar.gz
pacman-08aa3d97ea3823f2919e7d66041438db9e7488a0.tar.xz
libalpm: fix alpm_option_set_assumeinstalled
It looks like this function has never actually worked. The current list is never set to NULL after being freed. So the new deps were just appended to the already freed list, leading to a segfault. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 0a25548cd0910f66dea2dfab21f75a6d15366d64)
-rw-r--r--lib/libalpm/handle.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index e3193f40..23464045 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -690,6 +690,7 @@ int SYMEXPORT alpm_option_set_assumeinstalled(alpm_handle_t *handle, alpm_list_t
if(handle->assumeinstalled) {
alpm_list_free_inner(handle->assumeinstalled, (alpm_list_fn_free)alpm_dep_free);
alpm_list_free(handle->assumeinstalled);
+ handle->assumeinstalled = NULL;
}
while(deps) {
if(alpm_option_add_assumeinstalled(handle, deps->data) != 0) {