From: Ben Pfaff Date: Fri, 9 Jan 2009 01:10:34 +0000 (-0800) Subject: netdev: Fix file descriptor leak. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8a8922aec0d0a9073fe4a4d063b8a591966f1d8;p=openvswitch netdev: Fix file descriptor leak. This could be important since it leaks a file descriptor on every netdev_open(), but only if an IPv6 address is configured on the network device (which is rare and indicates an error condition for OpenFlow). Found by Chris Eagle via Fortify. --- diff --git a/lib/netdev.c b/lib/netdev.c index 67966015..5d6f2246 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -145,6 +145,7 @@ get_ipv6_address(const char *name, struct in6_addr *in6) ifname) == 17 && !strcmp(name, ifname)) { + fclose(file); return; } }