summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-10-25 01:59:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:24:38 -0500
commitcc22f65d7b31518ae11beb4e06aca8c9d91883f1 (patch)
tree6c3b1bc03c8dbbdde72916fa5bbe3edacb54541d /source4
parent7f833458ca0083654e34cbfde1c6c6510cab1826 (diff)
downloadsamba-cc22f65d7b31518ae11beb4e06aca8c9d91883f1.tar.gz
samba-cc22f65d7b31518ae11beb4e06aca8c9d91883f1.tar.bz2
samba-cc22f65d7b31518ae11beb4e06aca8c9d91883f1.zip
r19490: better to check the return result
(This used to be commit abdc4edbb8f8b8234bad1be05fa92b3f3bc8876c)
Diffstat (limited to 'source4')
-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);