s4-dsdb: use ldb_msg_diff_ex() in source4/dsdb/schema/schema_set.c
[kamenim/samba.git] / source4 / dsdb / schema / schema_set.c
index 5d636706212e9ef790d7f6e143cfa30397547b2a..e786c7d20f68d67e56cbb3d23c6701a11ab32029 100644 (file)
@@ -137,7 +137,10 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
                /* Annoyingly added to our search results */
                ldb_msg_remove_attr(res->msgs[0], "distinguishedName");
                
-               mod_msg = ldb_msg_diff(ldb, res->msgs[0], msg);
+               ret = ldb_msg_diff_ex(ldb, res->msgs[0], msg, mem_ctx, &mod_msg);
+               if (ret != LDB_SUCCESS) {
+                       goto op_error;
+               }
                if (mod_msg->num_elements > 0) {
                        ret = dsdb_replace(ldb, mod_msg, 0);
                }
@@ -167,7 +170,11 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
                /* Annoyingly added to our search results */
                ldb_msg_remove_attr(res_idx->msgs[0], "distinguishedName");
 
-               mod_msg = ldb_msg_diff(ldb, res_idx->msgs[0], msg_idx);
+               ret = ldb_msg_diff_ex(ldb, res_idx->msgs[0], msg_idx,
+                                     mem_ctx, &mod_msg);
+               if (ret != LDB_SUCCESS) {
+                       goto op_error;
+               }
                if (mod_msg->num_elements > 0) {
                        ret = dsdb_replace(ldb, mod_msg, 0);
                }