Index: src/platform-freebsd.cc |
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc |
index 67e52ce9479cabd209e347c04cca680299641e28..b1075cf3217d5d5ab3bfba65acb8d92657da7290 100644 |
--- a/src/platform-freebsd.cc |
+++ b/src/platform-freebsd.cc |
@@ -286,14 +286,12 @@ void OS::LogSharedLibraryAddresses() { |
int OS::StackWalk(Vector<OS::StackFrame> frames) { |
int frames_size = frames.length(); |
- void** addresses = NewArray<void*>(frames_size); |
+ ScopedVector<void*> addresses(frames_size); |
- int frames_count = backtrace(addresses, frames_size); |
+ int frames_count = backtrace(addresses.start(), frames_size); |
- char** symbols; |
- symbols = backtrace_symbols(addresses, frames_count); |
+ char** symbols = backtrace_symbols(addresses, frames_count); |
if (symbols == NULL) { |
- DeleteArray(addresses); |
return kStackWalkError; |
} |
@@ -308,7 +306,6 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) { |
frames[i].text[kStackWalkMaxTextLen - 1] = '\0'; |
} |
- DeleteArray(addresses); |
free(symbols); |
return frames_count; |