From 554963d8877d2260ec36ff4bc097499606386d11 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 19 Nov 2015 09:02:46 +0100 Subject: [PATCH] nwrap: Cleanup shadow getspnam() memory Signed-off-by: Andreas Schneider Signed-off-by: Michael Adam --- lib/nss_wrapper/nss_wrapper.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 562efba2515..914cd26e3fb 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -5551,6 +5551,18 @@ void nwrap_destructor(void) nwrap_pw_global.num = 0; } + if (nwrap_sp_global.cache != NULL) { + struct nwrap_cache *c = nwrap_sp_global.cache; + + nwrap_files_cache_unload(c); + if (c->fd >= 0) { + fclose(c->fp); + c->fd = -1; + } + + nwrap_he_global.num = 0; + } + if (nwrap_he_global.cache != NULL) { struct nwrap_cache *c = nwrap_he_global.cache; -- 2.34.1