---
src/lxc/namespace.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c
index 8263fe7..5928eaa 100644
--- a/src/lxc/namespace.c
+++ b/src/lxc/namespace.c
@@ -67,9 +67,14 @@ pid_t lxc_clone(int (*fn)(void *), void *arg, int flags)
};
long stack_size = sysconf(_SC_PAGESIZE);
- void *stack = alloca(stack_size) + stack_size;
+ void *stack = alloca(stack_size);
pid_t ret;
+ if (stack == NULL)
+ ERROR("failed to allocate memory");
+
+ stack += stack_size;
+
#ifdef __ia64__
ret = __clone2(do_clone, stack,
stack_size, flags | SIGCHLD, &clone_arg);
--
1.7.0.4
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Lxc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxc-devel