From f183dcfad56c7eb9b188dcfbf4d4b7a2598ef08c Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Thu, 28 Sep 2017 16:19:29 +1300 Subject: [PATCH] replmd: Fix talloc inconsistency in replmd_set_la_val() All the other talloc_asprintf()s in this function use the mem_ctx, but for some reason the vstring was using the dsdb_dn->dn. This probably isn't a big deal, but might have unintentional side-effects. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13055 Signed-off-by: Tim Beale Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index a7ee2d70fbb..18fc097701b 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2373,7 +2373,7 @@ static int replmd_set_la_val(TALLOC_CTX *mem_ctx, struct ldb_val *v, struct dsdb ret = ldb_dn_set_extended_component(dn, "RMD_LOCAL_USN", &local_usnv); if (ret != LDB_SUCCESS) return ret; - vstring = talloc_asprintf(dn, "%lu", (unsigned long)version); + vstring = talloc_asprintf(mem_ctx, "%lu", (unsigned long)version); vers = data_blob_string_const(vstring); ret = ldb_dn_set_extended_component(dn, "RMD_VERSION", &vers); if (ret != LDB_SUCCESS) return ret; -- 2.11.4.GIT