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

r19370: Handle errors if talloc_reference fails

This commit is contained in:
Simo Sorce 2006-10-17 12:35:33 +00:00 committed by Gerald (Jerry) Carter
parent 0c26c2aefd
commit 05134a90e3

View File

@ -204,9 +204,14 @@ static int ldb_msg_replace(struct ldb_message *msg, const struct ldb_message_ele
/* copy new element */
*old = *el;
/* and make sure we reference the contents */
talloc_reference(msg->elements, el->name);
talloc_reference(msg->elements, el->values);
if (!talloc_reference(msg->elements, el->name)) {
return -1;
}
if (!talloc_reference(msg->elements, el->values)) {
return -1;
}
return 0;
}