From 5c46b3b9f71658fc07d45f4be058c5831a2abc44 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 13 May 2024 14:31:33 +0000 Subject: [PATCH] Fix memory leak: clean up alt requests --- nmap_dns.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nmap_dns.cc b/nmap_dns.cc index 776be44c1..3265618c4 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -226,6 +226,12 @@ struct request { dns_server *curr_server; u16 id; bool alt_req; + ~request() { + if (alt_req && targ) { + delete targ; + targ = NULL; + } + } }; /*keeps record of a request going through a particular DNS server