diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 5db7104334d6b60a033f0573243d67481ffc0b8f..09f6a46d61b8eb8f59e095747282c7a7f19fabb4 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -435,6 +435,7 @@ static int local_opendir(FsContext *ctx, stream = fdopendir(dirfd); if (!stream) { + close(dirfd); return -1; } fs->dir.stream = stream;