From 2bd9363203c30f701e92f7375cf272b30b0e4133 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 10 Mar 2021 16:30:16 +1300 Subject: [PATCH] ldb-samba: avoid use-after-free in dsdb_match_for_dns_to_tombstone_time Signed-off-by: Douglas Bagnall --- lib/ldb-samba/ldb_matching_rules.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ldb-samba/ldb_matching_rules.c b/lib/ldb-samba/ldb_matching_rules.c index d62fb543eb0..62fbb43207c 100644 --- a/lib/ldb-samba/ldb_matching_rules.c +++ b/lib/ldb-samba/ldb_matching_rules.c @@ -428,20 +428,20 @@ static int dsdb_match_for_dns_to_tombstone_time(struct ldb_context *ldb, } if (rec->wType == DNS_TYPE_SOA || rec->wType == DNS_TYPE_NS) { - TALLOC_FREE(tmp_ctx); + TALLOC_FREE(rec); continue; } if (rec->wType == DNS_TYPE_TOMBSTONE) { - TALLOC_FREE(tmp_ctx); + TALLOC_FREE(rec); continue; } if (rec->dwTimeStamp == 0) { - TALLOC_FREE(tmp_ctx); + TALLOC_FREE(rec); continue; } if (rec->dwTimeStamp > tombstone_time) { - TALLOC_FREE(tmp_ctx); + TALLOC_FREE(rec); continue; } -- 2.25.1