mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 10:51:24 +00:00
Merge pull request #1638 from 0x0916/fix-memory-resource-leak
fix memory and resource leak
This commit is contained in:
commit
af36a8ee9c
@ -207,6 +207,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);
|
||||
|
Loading…
Reference in New Issue
Block a user