summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-07-16 14:18:14 +0300
committerAndrew Bartlett <abartlet@samba.org>2010-07-19 17:33:35 +1000
commit31aeb841c9823574cb6f13986f4da34d00bb40a1 (patch)
tree87e401f293054a13ca09922dcaee9bd9830efdd4 /source4/lib
parent1e20dbd8127bcecda8e4a656d326b391cc5c8e8d (diff)
downloadsamba-31aeb841c9823574cb6f13986f4da34d00bb40a1.tar.gz
samba-31aeb841c9823574cb6f13986f4da34d00bb40a1.tar.bz2
samba-31aeb841c9823574cb6f13986f4da34d00bb40a1.zip
s4-dsdb: use ldb_msg_normalize() in ldb_msg_difference()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/common/ldb_msg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index a643004605..8cf2584413 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -705,15 +705,17 @@ int ldb_msg_difference(struct ldb_context *ldb,
mod->num_elements = 0;
mod->elements = NULL;
- /* canonicalize msg2 so we have no repeated elements */
- msg2 = ldb_msg_canonicalize(ldb, msg2);
- if (msg2 == NULL) {
+ /*
+ * Canonicalize *msg2 so we have no repeated elements
+ * Resulting message is allocated in *mod's mem context,
+ * as we are going to move some elements from *msg2 to
+ * *mod object later
+ */
+ ldb_res = ldb_msg_normalize(ldb, mod, msg2, &msg2);
+ if (ldb_res != LDB_SUCCESS) {
goto failed;
}
- /* steal msg2 into mod context as it is allocated in ldb's context */
- talloc_steal(mod, msg2);
-
/* look in msg2 to find elements that need to be added or modified */
for (i=0;i<msg2->num_elements;i++) {
el = ldb_msg_find_element(msg1, msg2->elements[i].name);