1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 14:39:02 +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

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