DiskIO (Windows): fix segfault and memleak

This commit is contained in:
李通洲
2023-12-17 19:40:24 +08:00
parent c3a28064f6
commit 4e4246a46a
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -14,10 +14,10 @@ typedef struct FFDiskIOResult
FFstrbuf name;
FFstrbuf interconnect;
FFstrbuf serial;
FFstrbuf devPath;
FFDiskIOPhysicalType type;
uint64_t size;
bool removable;
FFstrbuf devPath;
uint64_t bytesRead;
uint64_t readCount;
uint64_t bytesWritten;
+1
View File
@@ -82,6 +82,7 @@ const char* ffDiskIOGetIoCounters(FFlist* result, FFDiskIOOptions* options)
continue;
}
ffStrbufInitWS(&device->devPath, szDevice);
ffStrbufInit(&device->serial);
if (sdd->SerialNumberOffset != 0)
{
+1
View File
@@ -114,6 +114,7 @@ void ffPrintDiskIO(FFDiskIOOptions* options)
ffStrbufDestroy(&dev->name);
ffStrbufDestroy(&dev->interconnect);
ffStrbufDestroy(&dev->devPath);
ffStrbufDestroy(&dev->serial);
}
}