summaryrefslogtreecommitdiffstats
path: root/src/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/api.c')
-rw-r--r--src/api.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api.c b/src/api.c
index 28365b4..d31cf4d 100644
--- a/src/api.c
+++ b/src/api.c
@@ -696,14 +696,17 @@ static int cg_test_mounted_fs()
temp_ent = (struct mntent *) malloc(sizeof(struct mntent));
if (!temp_ent) {
/* We just fail at the moment. */
+ fclose(proc_mount);
return 0;
}
ent = getmntent_r(proc_mount, temp_ent, mntent_buff,
sizeof(mntent_buff));
- if (!ent)
- return 0;
+ if (!ent) {
+ ret = 0;
+ goto done;
+ }
while (strcmp(ent->mnt_type, "cgroup") !=0) {
ent = getmntent_r(proc_mount, temp_ent, mntent_buff,