summaryrefslogtreecommitdiff
path: root/lib/ldb-samba
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2021-03-10 16:30:16 +1300
committerJeremy Allison <jra@samba.org>2021-03-30 17:53:30 +0000
commit56483a2799430d36dcb9036b8a6f5eece959ba9f (patch)
treec2bae4f5776f7d94d36a079901e23e890b30b7f1 /lib/ldb-samba
parent140007bfe1795e5bc5bca43238b6be03e0693f9e (diff)
downloadsamba-56483a2799430d36dcb9036b8a6f5eece959ba9f.tar.gz
ldb-samba: avoid leak in dsdb_match_for_dns_to_tombstone_time
After the first time through the loop, tmp_ctx has been freed and NULLed, so we end up allocating on NULL and never freeing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14659 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/ldb-samba')
-rw-r--r--lib/ldb-samba/ldb_matching_rules.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ldb-samba/ldb_matching_rules.c b/lib/ldb-samba/ldb_matching_rules.c
index 26f4d4ed3b5..dc381854ab8 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;
}