/* we have to canonicalise here, as so many places
* in modules and backends assume we don't have two
* elements with the same name */
- req->op.add.message = ldb_msg_canonicalize(ldb, req->op.add.message);
- if (!req->op.add.message) {
+ ret = ldb_msg_canonicalize_ex(ldb, req->op.add.message,
+ (TALLOC_CTX*)req,
+ discard_const(&req->op.add.message));
+ if (ret != LDB_SUCCESS) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
- talloc_steal(req, req->op.add.message);
FIRST_OP(ldb, add);
ret = module->ops->add(module, req);
break;