summaryrefslogtreecommitdiff
path: root/src/responder
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-05-06 13:12:31 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-05-06 10:24:36 -0400
commit89519c1ec01a8801e5d3d937416dca009126336b (patch)
tree6919b8e5cd6a3644329e35976855385a4d12a485 /src/responder
parent628187049e815ee54637398c8011883d762c8a64 (diff)
downloadsssd-89519c1ec01a8801e5d3d937416dca009126336b.tar.gz
sssd-89519c1ec01a8801e5d3d937416dca009126336b.tar.bz2
sssd-89519c1ec01a8801e5d3d937416dca009126336b.zip
Do not leak netgroups hash table
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/nss/nsssrv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
index dfb0312e..95a1549f 100644
--- a/src/responder/nss/nsssrv.c
+++ b/src/responder/nss/nsssrv.c
@@ -158,6 +158,17 @@ static void nss_dp_reconnect_init(struct sbus_connection *conn,
/* nss_shutdown(rctx); */
}
+static int nss_ctx_destructor(void *memctx)
+{
+ struct nss_ctx *nctx = (struct nss_ctx *) memctx;
+
+ if (nctx->netgroups) {
+ hash_destroy(nctx->netgroups);
+ nctx->netgroups = NULL;
+ }
+ return 0;
+}
+
int nss_process_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct confdb_ctx *cdb)
@@ -173,6 +184,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
DEBUG(0, ("fatal error initializing nss_ctx\n"));
return ENOMEM;
}
+ talloc_set_destructor((TALLOC_CTX *) nctx, nss_ctx_destructor);
ret = sss_ncache_init(nctx, &nctx->ncache);
if (ret != EOK) {