init_parse_tree() now takes ownership of lhost and shost, if any.

This means that lhost and shost in struct sudoers_parse_tree
are no longer const and that free_parse_tree() will free lhost/shost.
The only consumer that passed in lho.st/shost was the SSSD back-end
which has been updated to avoid a double-free.
This commit is contained in:
Todd C. Miller
2021-11-19 12:29:21 -07:00
parent cc79038730
commit 730ebabdba
5 changed files with 15 additions and 10 deletions

View File

@@ -532,9 +532,6 @@ sudo_sss_close(struct sudo_nss *nss)
sudo_dso_unload(handle->ssslib);
if (handle->pw != NULL)
sudo_pw_delref(handle->pw);
free(handle->ipa_host);
if (handle->ipa_host != handle->ipa_shost)
free(handle->ipa_shost);
free_parse_tree(&handle->parse_tree);
free(handle);
nss->handle = NULL;