From 2128edfba22782853b020ee69af1ac0a5ea873f5 Mon Sep 17 00:00:00 2001 From: Ximalas Date: Mon, 11 Oct 2021 22:04:02 +0200 Subject: 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. --- freebsd/Platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3