1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

r19490: better to check the return result

(This used to be commit abdc4edbb8)
This commit is contained in:
Simo Sorce 2006-10-25 01:59:07 +00:00 committed by Gerald (Jerry) Carter
parent 7f833458ca
commit cc22f65d7b

View File

@ -183,13 +183,14 @@ int ldb_msg_add_value(struct ldb_message *msg,
{ {
struct ldb_message_element *el; struct ldb_message_element *el;
struct ldb_val *vals; struct ldb_val *vals;
int ret;
el = ldb_msg_find_element(msg, attr_name); el = ldb_msg_find_element(msg, attr_name);
if (!el) { if (!el) {
ldb_msg_add_empty(msg, attr_name, 0, &el); ret = ldb_msg_add_empty(msg, attr_name, 0, &el);
} if (ret != LDB_SUCCESS) {
if (!el) { return ret;
return LDB_ERR_OPERATIONS_ERROR; }
} }
vals = talloc_realloc(msg, el->values, struct ldb_val, el->num_values+1); vals = talloc_realloc(msg, el->values, struct ldb_val, el->num_values+1);