1
0
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:
david
2009-08-24 21:07:47 +00:00
parent cb226847e5
commit cfeb9d6563

View File

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