s4 dsdb/repl_meta_data: allocate new extended DNs during ADD on a better context
authorAndrew Bartlett <abartlet@samba.org>
Wed, 15 May 2019 02:47:53 +0000 (14:47 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 May 2019 04:03:37 +0000 (04:03 +0000)
Lower down in this function new_values is assigned over el->values and is
filled in with the values of all the parsed DNs.  Therefore it is the natural
talloc parent.

This will allow el->values to be allocated on tmp_ctx in the next commit for
a working area during the function call.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index e68a376a79e9bc83f2afcc3331fffba29a02b57e..6c65820e84ef8a5e651849dfc7b4803f59943bff 100644 (file)
@@ -1052,7 +1052,7 @@ static int replmd_add_fix_la(struct ldb_module *module, TALLOC_CTX *mem_ctx,
 
        for (i = 0; i < el->num_values; i++) {
                struct parsed_dn *p = &pdn[i];
-               ret = replmd_build_la_val(el->values, p->v, p->dsdb_dn,
+               ret = replmd_build_la_val(new_values, p->v, p->dsdb_dn,
                                          &ac->our_invocation_id,
                                          ac->seq_num, now);
                if (ret != LDB_SUCCESS) {