From: Tim Beale Date: Thu, 28 Sep 2017 03:19:29 +0000 (+1300) Subject: replmd: Fix talloc inconsistency in replmd_set_la_val() X-Git-Tag: tevent-0.9.34~152 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f183dcfad56c7eb9b188dcfbf4d4b7a2598ef08c;p=thirdparty%2Fsamba.git 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 --- 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;