aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTobias Sargeant <tobiasjs@google.com>2017-08-30 13:04:15 +0100
committerTobias Sargeant <tobiasjs@chromium.org>2017-08-30 17:28:54 +0000
commitc4335f04356afe67cabc4cf5eb3d1f16294c3a03 (patch)
tree05b41273978af9f022f7c808647a4998fb7be117 /src
parentUpdate GYP to 324dd166b7c0b39d513026fa52d6280ac6d56770 (diff)
downloadbreakpad-c4335f04356afe67cabc4cf5eb3d1f16294c3a03.tar.xz
Fix memory leak in ppc64 stackwalker
BUG=757166 Change-Id: I967a6903332b9c3d16b583f7fa4d3c9c44c2f729 Reviewed-on: https://chromium-review.googlesource.com/643267 Reviewed-by: Leonard Mosescu <mosescu@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/processor/stackwalker_ppc64.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/processor/stackwalker_ppc64.cc b/src/processor/stackwalker_ppc64.cc
index 4fd9e740..fb2bac3c 100644
--- a/src/processor/stackwalker_ppc64.cc
+++ b/src/processor/stackwalker_ppc64.cc
@@ -32,6 +32,7 @@
// See stackwalker_ppc64.h for documentation.
+#include "common/scoped_ptr.h"
#include "processor/stackwalker_ppc64.h"
#include "google_breakpad/processor/call_stack.h"
#include "google_breakpad/processor/memory_region.h"
@@ -112,7 +113,7 @@ StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack,
return NULL;
}
- StackFramePPC64* frame = new StackFramePPC64();
+ scoped_ptr<StackFramePPC64> frame(new StackFramePPC64());
frame->context = last_frame->context;
frame->context.srr0 = instruction;
@@ -138,7 +139,7 @@ StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack,
// return address value may access the context.srr0 field of StackFramePPC64.
frame->instruction = frame->context.srr0 - 8;
- return frame;
+ return frame.release();
}