vswitchd: Fix fd leaks by closing files that we read in read_file().
authorBen Pfaff <blp@nicira.com>
Wed, 31 Dec 2008 00:06:06 +0000 (16:06 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 31 Dec 2008 00:06:06 +0000 (16:06 -0800)
Fixes bug #697.

Thanks to Martin for reporting this bug.

vswitchd/cfg.c

index 55f43199eb0d977ede58064abada02d0869f213b..b0915494d2ad0db847f5f209243bbf11de936950 100644 (file)
@@ -615,6 +615,8 @@ read_file(const char *file_name)
 
     svec_sort(&cfg);
     svec_terminate(&cfg);
+
+    fclose(file);
 }
 
 static int