From 11676d3d56ce78c5a2fda453a6dda488b450aa25 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 11 Apr 2023 16:51:25 +1000 Subject: [PATCH] [common] windows: fix invalid free of stack allocated memory --- common/src/platform/windows/ivshmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/src/platform/windows/ivshmem.c b/common/src/platform/windows/ivshmem.c index b01dec58..1098becb 100644 --- a/common/src/platform/windows/ivshmem.c +++ b/common/src/platform/windows/ivshmem.c @@ -171,7 +171,6 @@ bool ivshmemInit(struct IVSHMEM * dev) if (handle == INVALID_HANDLE_VALUE) { SetupDiDestroyDeviceInfoList(devInfoSet); - free(infData); DEBUG_WINERROR("CreateFile returned INVALID_HANDLE_VALUE", GetLastError()); return false; } @@ -199,7 +198,7 @@ bool ivshmemOpen(struct IVSHMEM * dev) if (!DeviceIoControl(info->handle, IOCTL_IVSHMEM_REQUEST_SIZE, NULL, 0, &size, sizeof(IVSHMEM_SIZE), NULL, NULL)) { DEBUG_WINERROR("DeviceIoControl Failed", GetLastError()); - return 0; + return false; } IVSHMEM_MMAP_CONFIG config = { .cacheMode = IVSHMEM_CACHE_WRITECOMBINED };