Shut up a memory leak warning

This commit is contained in:
Eelco Dolstra 2017-07-12 19:24:20 +02:00
parent 2965d40612
commit 0681f8c907
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -52,7 +52,8 @@ void detectStackOverflow()
delivered when we're out of stack space. */
stack_t stack;
stack.ss_size = 4096 * 4 + MINSIGSTKSZ;
stack.ss_sp = new char[stack.ss_size];
static auto stackBuf = std::make_unique<std::vector<char>>(stack.ss_size);
stack.ss_sp = stackBuf->data();
if (!stack.ss_sp) throw Error("cannot allocate alternative stack");
stack.ss_flags = 0;
if (sigaltstack(&stack, 0) == -1) throw SysError("cannot set alternative stack");