diff options
author | Aaron Ball <nullspoon@oper.io> | 2022-06-21 20:51:06 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2022-06-21 20:51:06 -0600 |
commit | 9de768f602b90fe09b2db91ad400ca96e48fe9bd (patch) | |
tree | 2c2708bbbc975fffd7bcb17ef2cf1bcaaf3f87bf | |
parent | 0d8e60016aac8d4fff94b6f9f417b68c8cf12ed6 (diff) | |
download | cmon-9de768f602b90fe09b2db91ad400ca96e48fe9bd.tar.gz cmon-9de768f602b90fe09b2db91ad400ca96e48fe9bd.tar.xz |
Close leaked file descriptor in meminfo constructor
-rw-r--r-- | src/meminfo.c | 1 |
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"); |