Commit 20fe4e8f by Dwight Engen Committed by Serge Hallyn

fix getline(3) memory leaks

parent fca3080f
...@@ -114,6 +114,7 @@ struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid) ...@@ -114,6 +114,7 @@ struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
} }
} }
free(line);
fclose(proc_file); fclose(proc_file);
if (!found) { if (!found) {
...@@ -145,7 +146,6 @@ struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid) ...@@ -145,7 +146,6 @@ struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
out_error: out_error:
free(info); free(info);
free(line);
return NULL; return NULL;
} }
......
...@@ -503,6 +503,7 @@ static char *get_all_cgroups(void) ...@@ -503,6 +503,7 @@ static char *get_all_cgroups(void)
} }
out: out:
free(line);
fclose(f); fclose(f);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment