[PATCH] D59005: Fix memory leak in CreateSigAltStack

Pietro Fezzardi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 16:08:59 PST 2019


fez added inline comments.


================
Comment at: llvm/lib/Support/Unix/Signals.inc:255
   AltStack.ss_sp = static_cast<char *>(safe_malloc(AltStackSize));
-  NewAltStackPointer = AltStack.ss_sp; // Save to avoid reporting a leak.
   AltStack.ss_size = AltStackSize;
----------------
The leak shows up here, whenever the execution reaches this point two times in a single execution. The first time is fine, but the second time the first alternate signal stack leaks, because `free` is not called before reassigning `NewAltStackPointer`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59005/new/

https://reviews.llvm.org/D59005





More information about the llvm-commits mailing list