projects
/
profile
/
ivi
/
murphy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
system-monitor: don't leak /proc/mounts fd.
[profile/ivi/murphy.git]
/
src
/
plugins
/
system-monitor
/
cgroup.c
diff --git
a/src/plugins/system-monitor/cgroup.c
b/src/plugins/system-monitor/cgroup.c
index
ce80f06
..
44b9df2
100644
(file)
--- a/
src/plugins/system-monitor/cgroup.c
+++ b/
src/plugins/system-monitor/cgroup.c
@@
-333,7
+333,11
@@
static const char *find_mount_point(cgroup_type_t type)
if ((fd = open("/proc/mounts", O_RDONLY)) < 0)
return NULL;
- if ((l = read(fd, mounts, sizeof(mounts) - 1)) <= 0)
+ l = read(fd, mounts, sizeof(mounts) - 1);
+
+ close(fd);
+
+ if (l <= 0)
return NULL;
else
mounts[l] = '\0';