mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
DiskIO (Windows): fix segfault and memleak
This commit is contained in:
@@ -14,10 +14,10 @@ typedef struct FFDiskIOResult
|
|||||||
FFstrbuf name;
|
FFstrbuf name;
|
||||||
FFstrbuf interconnect;
|
FFstrbuf interconnect;
|
||||||
FFstrbuf serial;
|
FFstrbuf serial;
|
||||||
|
FFstrbuf devPath;
|
||||||
FFDiskIOPhysicalType type;
|
FFDiskIOPhysicalType type;
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
bool removable;
|
bool removable;
|
||||||
FFstrbuf devPath;
|
|
||||||
uint64_t bytesRead;
|
uint64_t bytesRead;
|
||||||
uint64_t readCount;
|
uint64_t readCount;
|
||||||
uint64_t bytesWritten;
|
uint64_t bytesWritten;
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ const char* ffDiskIOGetIoCounters(FFlist* result, FFDiskIOOptions* options)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ffStrbufInitWS(&device->devPath, szDevice);
|
||||||
ffStrbufInit(&device->serial);
|
ffStrbufInit(&device->serial);
|
||||||
if (sdd->SerialNumberOffset != 0)
|
if (sdd->SerialNumberOffset != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ void ffPrintDiskIO(FFDiskIOOptions* options)
|
|||||||
ffStrbufDestroy(&dev->name);
|
ffStrbufDestroy(&dev->name);
|
||||||
ffStrbufDestroy(&dev->interconnect);
|
ffStrbufDestroy(&dev->interconnect);
|
||||||
ffStrbufDestroy(&dev->devPath);
|
ffStrbufDestroy(&dev->devPath);
|
||||||
|
ffStrbufDestroy(&dev->serial);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user