From 7a390a0dabcdadb30196662b6cdec512bf81dcb4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 21 Oct 2006 00:10:19 +0000 Subject: r19430: merge recent ldb changes from Samba4. This includes memory leak fixes and significant speedups (This used to be commit bb5c205fef90aa8b89ba400fb9f2f37a111676a8) --- source3/lib/ldb/modules/ldb_map_outbound.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/lib/ldb/modules/ldb_map_outbound.c') diff --git a/source3/lib/ldb/modules/ldb_map_outbound.c b/source3/lib/ldb/modules/ldb_map_outbound.c index e1b207f6eb..cd33f29043 100644 --- a/source3/lib/ldb/modules/ldb_map_outbound.c +++ b/source3/lib/ldb/modules/ldb_map_outbound.c @@ -202,7 +202,16 @@ 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 */ + if (!talloc_reference(msg->elements, el->name)) { + return -1; + } + if (!talloc_reference(msg->elements, el->values)) { + return -1; + } return 0; } -- cgit