diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-08-14 16:08:47 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-14 10:05:14 +0200 |
commit | 956678685325a79a315f4ef19c0d834fd1747e4c (patch) | |
tree | 62b89848fbf552187a07d1d520702112f3b4ac45 /source4/dsdb/schema | |
parent | 0f2a87b547be43b4764c48350fd03ff22e086806 (diff) | |
download | samba-956678685325a79a315f4ef19c0d834fd1747e4c.tar.gz samba-956678685325a79a315f4ef19c0d834fd1747e4c.tar.bz2 samba-956678685325a79a315f4ef19c0d834fd1747e4c.zip |
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 <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 1771b267cd..8385ac2def 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -897,7 +897,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, } schema->fsmo.master_dn = ldb_msg_find_attr_as_dn(ldb, schema, schema_res->msgs[0], "fSMORoleOwner"); - if (ldb_dn_compare(samdb_ntds_settings_dn(ldb), schema->fsmo.master_dn) == 0) { + if (ldb_dn_compare(samdb_ntds_settings_dn(ldb, tmp_ctx), schema->fsmo.master_dn) == 0) { schema->fsmo.we_are_master = true; } else { schema->fsmo.we_are_master = false; |