summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/common/ldb_msg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index da8ab4994f..9cb4cf5ed0 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -183,13 +183,14 @@ int ldb_msg_add_value(struct ldb_message *msg,
{
struct ldb_message_element *el;
struct ldb_val *vals;
+ int ret;
el = ldb_msg_find_element(msg, attr_name);
if (!el) {
- ldb_msg_add_empty(msg, attr_name, 0, &el);
- }
- if (!el) {
- return LDB_ERR_OPERATIONS_ERROR;
+ ret = ldb_msg_add_empty(msg, attr_name, 0, &el);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
}
vals = talloc_realloc(msg, el->values, struct ldb_val, el->num_values+1);