summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2022-06-21 20:51:06 -0600
committerAaron Ball <nullspoon@oper.io>2022-06-21 20:51:06 -0600
commit9de768f602b90fe09b2db91ad400ca96e48fe9bd (patch)
tree2c2708bbbc975fffd7bcb17ef2cf1bcaaf3f87bf /src
parent0d8e60016aac8d4fff94b6f9f417b68c8cf12ed6 (diff)
downloadcmon-9de768f602b90fe09b2db91ad400ca96e48fe9bd.tar.gz
cmon-9de768f602b90fe09b2db91ad400ca96e48fe9bd.tar.xz
Close leaked file descriptor in meminfo constructor
Diffstat (limited to 'src')
-rw-r--r--src/meminfo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/meminfo.c b/src/meminfo.c
index 223a80c..dc3ead0 100644
--- a/src/meminfo.c
+++ b/src/meminfo.c
@@ -31,6 +31,7 @@ int meminfo_init(struct meminfo* m) {
status += fscanf(fd, "Cached: %ld kB\n", &m->cached);
// Custom value
m->used = m->total - m->free - m->buffers - m->cached;
+ fclose(fd);
if(status > 5) {
fprintf(stderr, "ERROR: Somehow read too many values from /proc/meminfo\n");

Generated by cgit