s4-dsdb: use ldb_operr() in the dsdb code
[vlendec/samba-autobuild/.git] / source4 / dsdb / samdb / ldb_modules / instancetype.c
index f71a8d39480f7f6c60e55c11b6544b28b3c77d5a..7360c7c993fee9bfac660d7d85c78f2f7ef8abf0 100644 (file)
@@ -118,7 +118,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
                 * entries (lost+found, deleted objects) */
                ac = talloc(req, struct it_context);
                if (ac == NULL) {
-                       return LDB_ERR_OPERATIONS_ERROR;
+                       return ldb_oom(ldb);
                }
                ac->module = module;
                ac->req = req;
@@ -140,8 +140,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
        /* we have to copy the message as the caller might have it as a const */
        msg = ldb_msg_copy_shallow(req, req->op.add.message);
        if (msg == NULL) {
-               ldb_oom(ldb);
-               return LDB_ERR_OPERATIONS_ERROR;
+               return ldb_oom(ldb);
        }
 
        /*
@@ -151,8 +150,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
 
        ret = ldb_msg_add_fmt(msg, "instanceType", "%u", instance_type);
        if (ret != LDB_SUCCESS) {
-               ldb_oom(ldb);
-               return LDB_ERR_OPERATIONS_ERROR;
+               return ldb_oom(ldb);
        }
 
        ret = ldb_build_add_req(&down_req, ldb, req,