From: Simo Sorce Date: Mon, 16 Oct 2006 02:45:18 +0000 (+0000) Subject: r19312: This should fix a nasty bug with values and names being freed before the... X-Git-Tag: samba-4.0.0alpha6~801^3~4485 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=508a04fe579ae3fcb9480f8e951cb6eaaf620d19;p=thirdparty%2Fsamba.git 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) --- diff --git a/source4/lib/ldb/modules/ldb_map_outbound.c b/source4/lib/ldb/modules/ldb_map_outbound.c index e1b207f6eb9..02876eea552 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; }