]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/file-posix.c
file-posix: Don't leak fd in hdev_get_max_segments
[mirror_qemu.git] / block / file-posix.c
index ac6bd9fae8e08f4d9429f5db0d1cfc2d49f6b26d..53febd3767756141a7ab9e7954e57a1ba16aa336 100644 (file)
@@ -703,6 +703,9 @@ static int hdev_get_max_segments(const struct stat *st)
     }
 
 out:
+    if (fd != -1) {
+        close(fd);
+    }
     g_free(sysfspath);
     return ret;
 #else