fix getline(3) memory leaks

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Dwight Engen 2013-05-21 15:36:32 -04:00 committed by Serge Hallyn
parent fca3080f6a
commit 20fe4e8feb
2 changed files with 2 additions and 1 deletions

View File

@ -114,6 +114,7 @@ struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
}
}
free(line);
fclose(proc_file);
if (!found) {
@ -145,7 +146,6 @@ struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
out_error:
free(info);
free(line);
return NULL;
}

View File

@ -503,6 +503,7 @@ static char *get_all_cgroups(void)
}
out:
free(line);
fclose(f);
return ret;
}