process_utils: free stack after return

Fixes: #3789 Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent cdfa8f13
...@@ -146,14 +146,12 @@ int lxc_raw_pidfd_send_signal(int pidfd, int sig, siginfo_t *info, ...@@ -146,14 +146,12 @@ int lxc_raw_pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
#define __LXC_STACK_SIZE (8 * 1024 * 1024) #define __LXC_STACK_SIZE (8 * 1024 * 1024)
pid_t lxc_clone(int (*fn)(void *), void *arg, int flags, int *pidfd) pid_t lxc_clone(int (*fn)(void *), void *arg, int flags, int *pidfd)
{ {
__do_free void *stack = NULL;
pid_t ret; pid_t ret;
void *stack;
stack = malloc(__LXC_STACK_SIZE); stack = malloc(__LXC_STACK_SIZE);
if (!stack) { if (!stack)
SYSERROR("Failed to allocate clone stack"); return syserror_set(-ENOMEM, "Failed to allocate clone stack");
return -ENOMEM;
}
#ifdef __ia64__ #ifdef __ia64__
ret = __clone2(fn, stack, __LXC_STACK_SIZE, flags | SIGCHLD, arg, pidfd); ret = __clone2(fn, stack, __LXC_STACK_SIZE, flags | SIGCHLD, arg, pidfd);
......
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