From cc22f65d7b31518ae11beb4e06aca8c9d91883f1 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 25 Oct 2006 01:59:07 +0000 Subject: r19490: better to check the return result (This used to be commit abdc4edbb8f8b8234bad1be05fa92b3f3bc8876c) --- source4/lib/ldb/common/ldb_msg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/lib/ldb/common') 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); -- cgit