diff options
-rw-r--r-- | source4/lib/ldb/modules/ldb_map_outbound.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/lib/ldb/modules/ldb_map_outbound.c b/source4/lib/ldb/modules/ldb_map_outbound.c index 02876eea55..cd33f29043 100644 --- a/source4/lib/ldb/modules/ldb_map_outbound.c +++ b/source4/lib/ldb/modules/ldb_map_outbound.c @@ -204,9 +204,14 @@ static int ldb_msg_replace(struct ldb_message *msg, const struct ldb_message_ele /* copy new element */ *old = *el; + /* and make sure we reference the contents */ - talloc_reference(msg->elements, el->name); - talloc_reference(msg->elements, el->values); + if (!talloc_reference(msg->elements, el->name)) { + return -1; + } + if (!talloc_reference(msg->elements, el->values)) { + return -1; + } return 0; } |