mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 22:49:01 +00:00
Fixed one of the memory leaks in getpts_simple which occures when no ports are to be added to 'list'. 'porttbl' is now free'd regardless of how the function returns.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Nmap Changelog ($Id$); -*-text-*-
|
# Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o Fixed one of the memory leaks in getpts_simple which occures when
|
||||||
|
no ports are to be added to 'list'. 'porttbl' is now free'd regardless
|
||||||
|
of how the function returns.
|
||||||
|
|
||||||
o Fixed a bug in the showOwner NSE script which caused it to try UDP
|
o Fixed a bug in the showOwner NSE script which caused it to try UDP
|
||||||
ports instead of just TCP ports. This made it very slow in the
|
ports instead of just TCP ports. This made it very slow in the
|
||||||
common case where there are many UDP ports in the open|filtered
|
common case where there are many UDP ports in the open|filtered
|
||||||
|
|||||||
4
nmap.cc
4
nmap.cc
@@ -2147,8 +2147,10 @@ void getpts_simple(const char *origexpr, int range_type,
|
|||||||
(*count)++;
|
(*count)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*count == 0)
|
if (*count == 0){
|
||||||
|
free(porttbl);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
*list = (unsigned short *) safe_zalloc(*count * sizeof(unsigned short));
|
*list = (unsigned short *) safe_zalloc(*count * sizeof(unsigned short));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user