diff options
author | Tobias Sargeant <tobiasjs@google.com> | 2017-08-17 14:57:38 +0100 |
---|---|---|
committer | Tobias Sargeant <tobiasjs@chromium.org> | 2017-08-18 10:24:52 +0000 |
commit | b1e7ec065d5d7312fd4534d8231a6164276cb281 (patch) | |
tree | d0769db13b64d311372077ae2f61dcf2df59c326 | |
parent | Add crash reason and address to microdumps. (diff) | |
download | breakpad-b1e7ec065d5d7312fd4534d8231a6164276cb281.tar.xz |
Fix memory leak in ppc stackwalker
BUG=756317
Change-Id: Id096372e5a0d1e7c70e95304b1f0c181f57d3882
Reviewed-on: https://chromium-review.googlesource.com/619126
Reviewed-by: Leonard Mosescu <mosescu@chromium.org>
-rw-r--r-- | src/processor/stackwalker_ppc.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/processor/stackwalker_ppc.cc b/src/processor/stackwalker_ppc.cc index c9ab144f..1e34c383 100644 --- a/src/processor/stackwalker_ppc.cc +++ b/src/processor/stackwalker_ppc.cc @@ -34,6 +34,7 @@ // Author: Mark Mentovai +#include "common/scoped_ptr.h" #include "processor/stackwalker_ppc.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/memory_region.h" @@ -121,7 +122,7 @@ StackFrame* StackwalkerPPC::GetCallerFrame(const CallStack* stack, return NULL; } - StackFramePPC* frame = new StackFramePPC(); + scoped_ptr<StackFramePPC> frame(new StackFramePPC()); frame->context = last_frame->context; frame->context.srr0 = instruction; @@ -147,7 +148,7 @@ StackFrame* StackwalkerPPC::GetCallerFrame(const CallStack* stack, // return address value may access the context.srr0 field of StackFramePPC. frame->instruction = frame->context.srr0 - 4; - return frame; + return frame.release(); } |