mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 10:52:08 +02:00
DiskIO (Windows): fix segfault and memleak
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -82,6 +82,7 @@ const char* ffDiskIOGetIoCounters(FFlist* result, FFDiskIOOptions* options)
|
||||
continue;
|
||||
}
|
||||
|
||||
ffStrbufInitWS(&device->devPath, szDevice);
|
||||
ffStrbufInit(&device->serial);
|
||||
if (sdd->SerialNumberOffset != 0)
|
||||
{
|
||||
|
||||
@@ -114,6 +114,7 @@ void ffPrintDiskIO(FFDiskIOOptions* options)
|
||||
ffStrbufDestroy(&dev->name);
|
||||
ffStrbufDestroy(&dev->interconnect);
|
||||
ffStrbufDestroy(&dev->devPath);
|
||||
ffStrbufDestroy(&dev->serial);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user