sd = get_new_descriptor(module, dn, req,
objectclass, parent_sd,
user_sd, NULL, sd_flags);
+ if (sd == NULL) {
+ return ldb_operr(ldb);
+ }
msg = ldb_msg_copy_shallow(req, req->op.add.message);
+ if (msg == NULL) {
+ return ldb_oom(ldb);
+ }
if (sd != NULL) {
if (sd_element != NULL) {
sd_element->values[0] = *sd;
sd = get_new_descriptor(module, dn, req,
objectclass, parent_sd,
user_sd, old_sd, sd_flags);
+ if (sd == NULL) {
+ return ldb_operr(ldb);
+ }
msg = ldb_msg_copy_shallow(req, req->op.mod.message);
+ if (msg == NULL) {
+ return ldb_oom(ldb);
+ }
if (sd != NULL) {
struct ldb_message_element *sd_element;
if (user_sd != NULL) {