Skip to content

Commit

Permalink
DiskIO (Windows): fix segfault and memleak
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Dec 17, 2023
1 parent c3a2806 commit 4e4246a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/detection/diskio/diskio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/detection/diskio/diskio_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const char* ffDiskIOGetIoCounters(FFlist* result, FFDiskIOOptions* options)
continue;
}

ffStrbufInitWS(&device->devPath, szDevice);
ffStrbufInit(&device->serial);
if (sdd->SerialNumberOffset != 0)
{
Expand Down
1 change: 1 addition & 0 deletions src/modules/diskio/diskio.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ void ffPrintDiskIO(FFDiskIOOptions* options)
ffStrbufDestroy(&dev->name);
ffStrbufDestroy(&dev->interconnect);
ffStrbufDestroy(&dev->devPath);
ffStrbufDestroy(&dev->serial);
}
}

Expand Down

0 comments on commit 4e4246a

Please sign in to comment.