git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0668f98
)
s4-dsdb: Use ldb_dn_copy() rather than talloc_reference()
author
Andrew Bartlett
<abartlet@samba.org>
Tue, 14 Aug 2012 07:49:12 +0000
(17:49 +1000)
committer
Andrew Bartlett
<abartlet@samba.org>
Tue, 14 Aug 2012 13:37:22 +0000
(15:37 +0200)
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
source4/dsdb/common/util.c
patch
|
blob
|
history
diff --git
a/source4/dsdb/common/util.c
b/source4/dsdb/common/util.c
index fd54e4adb94d9af4f1b33951e6960df372430620..565dc3630633e3d3009a9ae0c3cc786b98e08bd8 100644
(file)
--- 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);