From cfeb9d6563ecd35ac7f2a413e9fa66185f1e1ac1 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 24 Aug 2009 21:07:47 +0000 Subject: [PATCH] fclose the /proc/net/route file handle after reading routes from it. --- tcpip.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tcpip.cc b/tcpip.cc index 516879996..b10b3e4d9 100644 --- a/tcpip.cc +++ b/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;