From 42fa74e91abe8bcf466c9152f89083a261ab0322 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sun, 26 Nov 2023 10:33:12 -0800 Subject: [PATCH] free handle resources before running scripts The primary purpose of this is to allow cleanup of file descriptors allocated by curl that were left open in the child. I am not aware of any issues caused by the open file descriptors, but think it better to not leave random open fd's lying around. Signed-off-by: Andrew Gregory --- lib/libalpm/util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 55003b9a..bd01e4a0 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -675,6 +675,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[], unsetenv("BASH_ENV"); umask(0022); _alpm_reset_signals(); + _alpm_handle_free(handle); execv(cmd, argv); /* execv only returns if there was an error */ fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno));