summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-10-16 02:45:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:07 -0500
commit508a04fe579ae3fcb9480f8e951cb6eaaf620d19 (patch)
treeedb1aaa11540793bc589ba7cc489a9ab6f15a13e
parent227831537ae5d50a36d21347cbec8940372859de (diff)
downloadsamba-508a04fe579ae3fcb9480f8e951cb6eaaf620d19.tar.gz
samba-508a04fe579ae3fcb9480f8e951cb6eaaf620d19.tar.bz2
samba-508a04fe579ae3fcb9480f8e951cb6eaaf620d19.zip
r19312: This should fix a nasty bug with values and names being freed before the results where used.
Seem that el is hanging out of a request, and the target is put on the final results. Still one to catch and fix, but this seem to cure most of them (This used to be commit bfeaa08fde805439dbda974be6fcb692957b00f1)
-rw-r--r--source4/lib/ldb/modules/ldb_map_outbound.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/lib/ldb/modules/ldb_map_outbound.c b/source4/lib/ldb/modules/ldb_map_outbound.c
index e1b207f6eb..02876eea55 100644
--- a/source4/lib/ldb/modules/ldb_map_outbound.c
+++ b/source4/lib/ldb/modules/ldb_map_outbound.c
@@ -202,7 +202,11 @@ static int ldb_msg_replace(struct ldb_message *msg, const struct ldb_message_ele
}
}
- *old = *el; /* copy new element */
+ /* copy new element */
+ *old = *el;
+ /* and make sure we reference the contents */
+ talloc_reference(msg->elements, el->name);
+ talloc_reference(msg->elements, el->values);
return 0;
}