summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb')
-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;
}