mirror of
https://github.com/nmap/nmap.git
synced 2026-06-20 15:41:31 +00:00
fclose the /proc/net/route file handle after reading routes from it.
This commit is contained in:
parent
cb226847e5
commit
cfeb9d6563
1 changed files with 4 additions and 2 deletions
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue