From 956678685325a79a315f4ef19c0d834fd1747e4c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 14 Aug 2012 16:08:47 +1000 Subject: s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dn As this value is calculated new each time, we need to give it a context to live on. If the value is the forced value during provision, a reference is taken. This was responsible for the memory leak in the replication process. In the example I was given, this DN appeared in memory 13596 times! Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104 --- source4/dsdb/kcc/kcc_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/dsdb/kcc/kcc_topology.c') diff --git a/source4/dsdb/kcc/kcc_topology.c b/source4/dsdb/kcc/kcc_topology.c index 9697ec12f7..2a9f2dd15c 100644 --- a/source4/dsdb/kcc/kcc_topology.c +++ b/source4/dsdb/kcc/kcc_topology.c @@ -1007,7 +1007,7 @@ static NTSTATUS kcctpl_bridgehead_dc_failed(struct ldb_context *ldb, tmp_ctx = talloc_new(ldb); NT_STATUS_HAVE_NO_MEMORY(tmp_ctx); - settings_dn = samdb_ntds_settings_dn(ldb); + settings_dn = samdb_ntds_settings_dn(ldb, tmp_ctx); if (!settings_dn) { DEBUG(1, (__location__ ": failed to find our own NTDS Settings " "DN\n")); -- cgit