1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r19490: better to check the return result

This commit is contained in:
Simo Sorce 2006-10-25 01:59:07 +00:00 committed by Gerald (Jerry) Carter
parent 0fa5d4bc22
commit abdc4edbb8

View File

@ -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);