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 <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2023-11-26 10:33:12 -08:00 committed by Allan McRae
parent 929bad61c0
commit 42fa74e91a

View file

@ -675,6 +675,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
unsetenv("BASH_ENV"); unsetenv("BASH_ENV");
umask(0022); umask(0022);
_alpm_reset_signals(); _alpm_reset_signals();
_alpm_handle_free(handle);
execv(cmd, argv); execv(cmd, argv);
/* execv only returns if there was an error */ /* execv only returns if there was an error */
fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno)); fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno));