summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhasso <hasso>2005-03-07 08:19:44 +0000
committerhasso <hasso>2005-03-07 08:19:44 +0000
commit42a66d7c484f95615e0364c4aa109ce5d095776a (patch)
tree614d2db868d903907a7257a9a1493325eb68cba0
parent3452d4752490516c3228da3700c93e2089e30083 (diff)
* if_proc.c, ipforward_proc.c, rtread_proc.c: Fix fd leaks.
[backport candidate]
-rw-r--r--zebra/ChangeLog4
-rw-r--r--zebra/if_proc.c1
-rw-r--r--zebra/ipforward_proc.c1
-rw-r--r--zebra/rtread_proc.c2
4 files changed, 8 insertions, 0 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index ad8cf7cc..7c121545 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,7 @@
+2005-03-07 Michael Sandee <voidptr@voidptr.sboost.org>
+
+ * if_proc.c, ipforward_proc.c, rtread_proc.c: Fix fd leaks.
+
2005-03-06 Hasso Tepper <hasso at quagga.net>
* interface.c: Fix CRC and frame errors statistics in Linux.
diff --git a/zebra/if_proc.c b/zebra/if_proc.c
index 199a8e70..504d2f3c 100644
--- a/zebra/if_proc.c
+++ b/zebra/if_proc.c
@@ -242,6 +242,7 @@ ifaddr_proc_ipv6 ()
connected_add_ipv6 (ifp, &p.prefix, p.prefixlen, NULL);
}
+ fclose (fp);
return 0;
}
#endif /* HAVE_IPV6 && HAVE_PROC_NET_IF_INET6 */
diff --git a/zebra/ipforward_proc.c b/zebra/ipforward_proc.c
index 443cb1c6..f83d88c3 100644
--- a/zebra/ipforward_proc.c
+++ b/zebra/ipforward_proc.c
@@ -141,6 +141,7 @@ ipforward_ipv6 ()
fgets (buf, 2, fp);
sscanf (buf, "%d", &ipforwarding);
+ fclose (fp);
return ipforwarding;
}
diff --git a/zebra/rtread_proc.c b/zebra/rtread_proc.c
index 6e021c32..491fc987 100644
--- a/zebra/rtread_proc.c
+++ b/zebra/rtread_proc.c
@@ -96,6 +96,7 @@ proc_route_read ()
rib_add_ipv4 (ZEBRA_ROUTE_KERNEL, zebra_flags, &p, &gateway, 0, 0, 0, 0);
}
+ fclose (fp);
return 0;
}
@@ -155,6 +156,7 @@ proc_ipv6_route_read ()
rib_add_ipv6 (ZEBRA_ROUTE_KERNEL, zebra_flags, &p, &gateway, 0, 0);
}
+ fclose (fp);
return 0;
}
#endif /* HAVE_IPV6 */