mirror of
https://github.com/nmap/nmap.git
synced 2026-10-20 19:01:56 +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:
parent
d6b1222295
commit
bbc2196eea
2 changed files with 7 additions and 1 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# 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
|
||||
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
|
||||
|
|
|
|||
4
nmap.cc
4
nmap.cc
|
|
@ -2147,8 +2147,10 @@ void getpts_simple(const char *origexpr, int range_type,
|
|||
(*count)++;
|
||||
}
|
||||
|
||||
if (*count == 0)
|
||||
if (*count == 0){
|
||||
free(porttbl);
|
||||
return;
|
||||
}
|
||||
|
||||
*list = (unsigned short *) safe_zalloc(*count * sizeof(unsigned short));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue