diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-07-12T17·24+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-07-14T09·40+0200 |
commit | 0681f8c9070f3a40899d3040370e460c249a74bd (patch) | |
tree | 1ee32defd702dcf776bf78750128f8c2198acf0c /src/libmain | |
parent | 2965d40612e16388ef2177d2a13d168848c6ca8a (diff) |
Shut up a memory leak warning
Diffstat (limited to 'src/libmain')
-rw-r--r-- | src/libmain/stack.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libmain/stack.cc b/src/libmain/stack.cc index 57b6a197c0f0..ab3baf62c3d4 100644 --- a/src/libmain/stack.cc +++ b/src/libmain/stack.cc @@ -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"); |