summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/modules/ldb_map_outbound.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/ldb/modules/ldb_map_outbound.c')
-rw-r--r--source3/lib/ldb/modules/ldb_map_outbound.c11
1 files changed, 10 insertions, 1 deletions
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;
}