summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXimalas <trond.endrestol@ximalas.info>2021-10-11 22:04:02 +0200
committerBenBE <BenBE@geshi.org>2021-10-12 09:09:00 +0200
commit2128edfba22782853b020ee69af1ac0a5ea873f5 (patch)
tree2e07e082948dcfcf07fa17f20306fb4d4c080223
parentd1c833fe951b059c8dda24a055ca7d1c291f10ff (diff)
Plug the memory leak for the Disk I/O meter
There are no functions in libdevstat to initialise or clean up memory. The simplest change is to mark the local variable info as static.
-rw-r--r--freebsd/Platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/freebsd/Platform.c b/freebsd/Platform.c
index a3f58fdd..9c88b40d 100644
--- a/freebsd/Platform.c
+++ b/freebsd/Platform.c
@@ -284,7 +284,7 @@ bool Platform_getDiskIO(DiskIOData* data) {
if (devstat_checkversion(NULL) < 0)
return false;
- struct devinfo info = { 0 };
+ static struct devinfo info = { 0 };
struct statinfo current = { .dinfo = &info };
// get number of devices

© 2014-2024 Faster IT GmbH | imprint | privacy policy