Unverified Commit 1430601e by 0x0916 Committed by Stéphane Graber

fix memory and resource leak

Signed-off-by: 's avatar0x0916 <w@laoqinren.net>
parent 23785031
......@@ -200,6 +200,7 @@ static struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
info = calloc(1, sizeof(*info));
if (!info) {
SYSERROR("Could not allocate memory.");
fclose(proc_file);
return NULL;
}
......
......@@ -754,8 +754,10 @@ int do_mkfs_exec_wrapper(void *args)
return -1;
ret = snprintf(mkfs, len, "mkfs.%s", data[0]);
if (ret < 0 || (size_t)ret >= len)
if (ret < 0 || (size_t)ret >= len) {
free(mkfs);
return -1;
}
TRACE("executing \"%s %s\"", mkfs, data[1]);
execlp(mkfs, mkfs, data[1], (char *)NULL);
......
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