dpif-linux: Fix file descriptor leak.
[sliver-openvswitch.git] / lib / dpif-linux.c
index 8216d18..9a72313 100644 (file)
@@ -419,7 +419,7 @@ dpif_linux_recv(struct dpif *dpif_, struct ofpbuf **bufp)
             return 0;
         } else {
             VLOG_WARN_RL(&error_rl, "%s: discarding message truncated "
-                         "from %zu bytes to %d",
+                         "from %"PRIu32" bytes to %d",
                          dpif_name(dpif_), msg->length, retval);
             error = ERANGE;
         }
@@ -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;
 }