summaryrefslogtreecommitdiff
path: root/source3/lib/ldb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/ldb')
-rw-r--r--source3/lib/ldb/common/ldb_msg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/ldb/common/ldb_msg.c b/source3/lib/ldb/common/ldb_msg.c
index 7e001f9180..0d9cb47882 100644
--- a/source3/lib/ldb/common/ldb_msg.c
+++ b/source3/lib/ldb/common/ldb_msg.c
@@ -209,7 +209,9 @@ int ldb_msg_add_steal_value(struct ldb_message *msg,
ret = ldb_msg_add_value(msg, attr_name, val);
if (ret == LDB_SUCCESS) {
struct ldb_message_element *el;
- el = ldb_msg_find_element(msg, attr_name);
+ if (!(el = ldb_msg_find_element(msg, attr_name))) {
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
talloc_steal(el->values, val->data);
}
return ret;