mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
o Fixed some memory leaks in NSE found with Valgrind. [Kris]
This commit is contained in:
parent
a3a6853c08
commit
743eb48856
4 changed files with 26 additions and 1 deletions
|
|
@ -20,6 +20,8 @@ o Fixed an integer overflow which prevented a target specification
|
|||
of "*.*.*.*" from working. Support for the CIDR /0 is now also
|
||||
available. [Kris]
|
||||
|
||||
o Fixed some memory leaks in NSE found with Valgrind. [Kris]
|
||||
|
||||
o Nmap now returns correct values for --iflist in windows even
|
||||
if interface aliases have been set. Previously it would misreport
|
||||
the windevices and not list all interfaces. [Michael]
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@ Target::~Target() {
|
|||
}
|
||||
|
||||
void Target::FreeInternal() {
|
||||
|
||||
/* Free the DNS name if we resolved one */
|
||||
if (hostname)
|
||||
free(hostname);
|
||||
|
|
@ -179,6 +178,12 @@ void Target::FreeInternal() {
|
|||
}
|
||||
|
||||
if (FPR) delete FPR;
|
||||
|
||||
if (o.script) {
|
||||
ScriptResults::iterator sriter;
|
||||
for (sriter = scriptResults.begin(); sriter != scriptResults.end(); sriter++)
|
||||
free((*sriter).id);
|
||||
}
|
||||
}
|
||||
|
||||
/* Creates a "presentation" formatted string out of the IPv4/IPv6 address.
|
||||
|
|
|
|||
13
nse_main.cc
13
nse_main.cc
|
|
@ -70,6 +70,9 @@ int process_mainloop(lua_State* L);
|
|||
int process_waiting2running(lua_State* L, int resume_arguments);
|
||||
int process_finalize(lua_State* L, unsigned int registry_idx);
|
||||
|
||||
// post execution
|
||||
int cleanup_threads(std::list<struct thread_record> trs);
|
||||
|
||||
static int panic (lua_State *L)
|
||||
{
|
||||
const char *err = lua_tostring(L, 1);
|
||||
|
|
@ -298,6 +301,7 @@ finishup:
|
|||
log_write(LOG_STDOUT, "%s: Script scanning completed.\n", SCRIPT_ENGINE);
|
||||
)
|
||||
lua_close(L);
|
||||
cleanup_threads(torun_threads);
|
||||
torun_scripts.clear();
|
||||
if(status != SCRIPT_ENGINE_SUCCESS) {
|
||||
error("%s: Aborting script scan.", SCRIPT_ENGINE);
|
||||
|
|
@ -751,4 +755,13 @@ int process_preparethread(lua_State* L, struct run_record rr, struct thread_reco
|
|||
return SCRIPT_ENGINE_SUCCESS;
|
||||
}
|
||||
|
||||
int cleanup_threads(std::list<struct thread_record> trs)
|
||||
{
|
||||
std::list<struct thread_record>::iterator triter;
|
||||
|
||||
for (triter = trs.begin(); triter != trs.end(); triter++)
|
||||
free((*triter).rr);
|
||||
|
||||
return SCRIPT_ENGINE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,6 +150,11 @@ Port::~Port() {
|
|||
free(serviceprobe_service);
|
||||
if (serviceprobe_fp)
|
||||
free(serviceprobe_fp);
|
||||
if (o.script) {
|
||||
ScriptResults::iterator sriter;
|
||||
for (sriter = scriptResults.begin(); sriter != scriptResults.end(); sriter++)
|
||||
free((*sriter).id);
|
||||
}
|
||||
}
|
||||
|
||||
// Uses the sd->{product,version,extrainfo} if available to fill
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue