mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
ldb: Add ldb_oom() calls in a couple of places.
This commit is contained in:
parent
079200b824
commit
1163c2ad54
@ -256,6 +256,7 @@ static int extended_search(struct ldb_module *module, struct ldb_request *req)
|
||||
|
||||
ac = talloc(req, struct extended_context);
|
||||
if (ac == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -273,6 +274,7 @@ static int extended_search(struct ldb_module *module, struct ldb_request *req)
|
||||
|
||||
down_req = talloc_zero(req, struct ldb_request);
|
||||
if (down_req == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -291,8 +293,10 @@ static int extended_search(struct ldb_module *module, struct ldb_request *req)
|
||||
}
|
||||
if (ac->remove_guid || ac->remove_sid) {
|
||||
new_attrs = copy_attrs(down_req, req->op.search.attrs);
|
||||
if (new_attrs == NULL)
|
||||
if (new_attrs == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
if (ac->remove_guid) {
|
||||
if (!add_attrs(down_req, &new_attrs, "objectGUID"))
|
||||
@ -339,6 +343,7 @@ static int extended_init(struct ldb_module *module)
|
||||
|
||||
req = talloc(module, struct ldb_request);
|
||||
if (req == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
|
||||
|
||||
down_req = talloc(req, struct ldb_request);
|
||||
if (down_req == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -81,6 +82,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
|
||||
down_req->op.add.message = msg = ldb_msg_copy_shallow(down_req, req->op.add.message);
|
||||
if (msg == NULL) {
|
||||
talloc_free(down_req);
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -316,6 +316,7 @@ static int kludge_acl_search(struct ldb_module *module, struct ldb_request *req)
|
||||
|
||||
ac = talloc(req, struct kludge_acl_context);
|
||||
if (ac == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -329,6 +330,7 @@ static int kludge_acl_search(struct ldb_module *module, struct ldb_request *req)
|
||||
|
||||
down_req = talloc_zero(req, struct ldb_request);
|
||||
if (down_req == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -417,6 +419,7 @@ static int kludge_acl_init(struct ldb_module *module)
|
||||
|
||||
data = talloc(module, struct kludge_private_data);
|
||||
if (data == NULL) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -424,6 +427,7 @@ static int kludge_acl_init(struct ldb_module *module)
|
||||
module->private_data = data;
|
||||
|
||||
if (!mem_ctx) {
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -453,6 +457,7 @@ static int kludge_acl_init(struct ldb_module *module)
|
||||
data->password_attrs = talloc_array(data, const char *, password_attributes->num_values + 1);
|
||||
if (!data->password_attrs) {
|
||||
talloc_free(mem_ctx);
|
||||
ldb_oom(module->ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
for (i=0; i < password_attributes->num_values; i++) {
|
||||
|
@ -72,7 +72,7 @@ static int samldb_set_next_rid(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
|
||||
|
||||
if (new_id == 0) {
|
||||
/* out of IDs ! */
|
||||
ldb_debug(ldb, LDB_DEBUG_FATAL, "Are we out of valid IDs ?\n");
|
||||
ldb_set_errstring(ldb, "Are we out of valid IDs ?\n");
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -81,6 +81,7 @@ static int samldb_set_next_rid(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
|
||||
ZERO_STRUCT(msg);
|
||||
msg.dn = ldb_dn_copy(mem_ctx, dn);
|
||||
if (!msg.dn) {
|
||||
ldb_oom(ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
msg.num_elements = 2;
|
||||
@ -91,6 +92,7 @@ static int samldb_set_next_rid(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
|
||||
els[0].flags = LDB_FLAG_MOD_DELETE;
|
||||
els[0].name = talloc_strdup(mem_ctx, "nextRid");
|
||||
if (!els[0].name) {
|
||||
ldb_oom(ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -101,12 +103,14 @@ static int samldb_set_next_rid(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
|
||||
|
||||
vals[0].data = (uint8_t *)talloc_asprintf(mem_ctx, "%u", old_id);
|
||||
if (!vals[0].data) {
|
||||
ldb_oom(ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
vals[0].length = strlen((char *)vals[0].data);
|
||||
|
||||
vals[1].data = (uint8_t *)talloc_asprintf(mem_ctx, "%u", new_id);
|
||||
if (!vals[1].data) {
|
||||
ldb_oom(ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
vals[1].length = strlen((char *)vals[1].data);
|
||||
|
Loading…
Reference in New Issue
Block a user