mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
fclose the /proc/net/route file handle after reading routes from it.
This commit is contained in:
6
tcpip.cc
6
tcpip.cc
@@ -3385,10 +3385,12 @@ struct sys_route *getsysroutes(int *howmany) {
|
||||
|
||||
/* First let us try Linux-style /proc/net/route */
|
||||
routefp = fopen("/proc/net/route", "r");
|
||||
if (routefp)
|
||||
if (routefp) {
|
||||
routes = getsysroutes_proc(routefp, howmany);
|
||||
else
|
||||
fclose(routefp);
|
||||
} else {
|
||||
routes = getsysroutes_dnet(howmany);
|
||||
}
|
||||
|
||||
numroutes = *howmany;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user