dpif-linux: Fix file descriptor leak. openflow-1.0
authorTetsuo NAKAGAWA <nakagawa@mxc.nes.nec.co.jp>
Thu, 25 Mar 2010 14:54:15 +0000 (10:54 -0400)
committerJesse Gross <jesse@nicira.com>
Thu, 25 Mar 2010 15:24:23 +0000 (11:24 -0400)
get_major() opens /proc/devices to get the openvswitch major number
but never closes the FD.

lib/dpif-linux.c

index 2bf329f..9a72313 100644 (file)
@@ -661,6 +661,8 @@ get_major(const char *target)
         }
     }
 
+    fclose(file);
+
     VLOG_ERR("%s: %s major not found (is the module loaded?)", fn, target);
     return -ENODEV;
 }