talloc_free(tmp_ctx);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
+
+ /*
+ * At the successful end of these functions el->values is
+ * overwritten with new_values. However get_parsed_dns()
+ * points p->v at the supplied el and it effectively gets used
+ * as a working area by replmd_build_la_val(). So we must
+ * duplicate it because our caller only called
+ * ldb_msg_copy_shallow().
+ */
+
+ el->values = talloc_memdup(tmp_ctx,
+ el->values,
+ sizeof(el->values[0]) * el->num_values);
+ if (el->values == NULL) {
+ ldb_module_oom(module);
+ talloc_free(tmp_ctx);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
ret = get_parsed_dns(module, tmp_ctx, el, &pdn,
sa->syntax->ldap_oid, parent);
return LDB_SUCCESS;
}
+ /*
+ * At the successful end of these functions el->values is
+ * overwritten with new_values. However get_parsed_dns()
+ * points p->v at the supplied el and it effectively gets used
+ * as a working area by replmd_build_la_val(). So we must
+ * duplicate it because our caller only called
+ * ldb_msg_copy_shallow().
+ */
+
+ el->values = talloc_memdup(tmp_ctx,
+ el->values,
+ sizeof(el->values[0]) * el->num_values);
+ if (el->values == NULL) {
+ ldb_module_oom(module);
+ talloc_free(tmp_ctx);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+
ret = get_parsed_dns(module, tmp_ctx, el, &dns, ldap_oid, parent);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);