mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Avoid duplicating udp payloads in memory
Storing a pointer instead of the whole struct payload enables us to reuse the same struct for as many ports as the payload defines, saving memory as well as the time to copy the struct and its std::string member. This commit also avoids several copy constructions and deletions of the payload vector for each port defined in the file.
This commit is contained in:
2
nmap.cc
2
nmap.cc
@@ -90,6 +90,7 @@
|
||||
#include "utils.h"
|
||||
#include "xml.h"
|
||||
#include "scan_lists.h"
|
||||
#include "payload.h"
|
||||
|
||||
#ifndef NOLUA
|
||||
#include "nse_main.h"
|
||||
@@ -1789,6 +1790,7 @@ void nmap_free_mem() {
|
||||
cp_free();
|
||||
free_services();
|
||||
freeinterfaces();
|
||||
free_payloads();
|
||||
AllProbes::service_scan_free();
|
||||
traceroute_hop_cache_clear();
|
||||
nsock_set_default_engine(NULL);
|
||||
|
||||
Reference in New Issue
Block a user