From: Tetsuo NAKAGAWA Date: Thu, 25 Mar 2010 14:54:15 +0000 (-0400) Subject: dpif-linux: Fix file descriptor leak. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed30fb10e116856481908b3c5af23f30aa5f7ff2;p=openvswitch dpif-linux: Fix file descriptor leak. get_major() opens /proc/devices to get the openvswitch major number but never closes the FD. --- diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index 4c343256..1eaba744 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -677,6 +677,8 @@ get_major(const char *target) } } + fclose(file); + VLOG_ERR("%s: %s major not found (is the module loaded?)", fn, target); return -ENODEV; }