summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-14 17:49:12 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-14 15:37:22 +0200
commit3c8d8f206b79280604cb79f263e74aa2b681726e (patch)
tree9806ef24053635d34271dc3105c54aece71bebe5 /source4/dsdb/common
parent0668f98d112f29f3fc7c306f69a9bea29eb8e2e1 (diff)
downloadsamba-3c8d8f206b79280604cb79f263e74aa2b681726e.tar.gz
samba-3c8d8f206b79280604cb79f263e74aa2b681726e.tar.bz2
samba-3c8d8f206b79280604cb79f263e74aa2b681726e.zip
s4-dsdb: Use ldb_dn_copy() rather than talloc_reference()
As the normal case (outside provision) uses a copy, this avoids a case where a caller might modify a global variable accidentily. As suggested by metze. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index fd54e4adb9..565dc36306 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1252,7 +1252,7 @@ struct ldb_dn *samdb_ntds_settings_dn(struct ldb_context *ldb, TALLOC_CTX *mem_c
/* see if we have a cached copy */
settings_dn = (struct ldb_dn *)ldb_get_opaque(ldb, "forced.ntds_settings_dn");
if (settings_dn) {
- return talloc_reference(mem_ctx, settings_dn);
+ return ldb_dn_copy(mem_ctx, settings_dn);
}
tmp_ctx = talloc_new(mem_ctx);