1
0
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:
michael
2008-05-28 20:14:44 +00:00
parent d6b1222295
commit bbc2196eea
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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));