From: Todd C. Miller <Todd.Miller@courtesan.com>
Date: Tue, 21 Mar 2017 15:52:51 +0000 (-0600)
Subject: zero out nss->handle after it has been freed to make sure we cannot free it twice
X-Git-Tag: SUDO_1_8_20^2~72
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1322d7dd9ac45d55240b7bbe3ca7a266f28f0e4;p=sudo

zero out nss->handle after it has been freed to make sure we cannot free it twice
---

diff --git a/plugins/sudoers/sssd.c b/plugins/sudoers/sssd.c
index c6725cfa8..195748224 100644
--- a/plugins/sudoers/sssd.c
+++ b/plugins/sudoers/sssd.c
@@ -481,6 +481,7 @@ sudo_sss_close(struct sudo_nss *nss)
 	handle = nss->handle;
 	sudo_dso_unload(handle->ssslib);
 	free(nss->handle);
+	nss->handle = NULL;
     }
     debug_return_int(0);
 }