Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1805)

Unified Diff: runtime/vm/os_linux.cc

Issue 12026036: Fix use after free bug in PprofCodeObserver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_linux.cc
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc
index 3c7495b46b0cc7ced5168cce75c97fd99d1ffe3f..400d35366bab3da93886e2db1d809f26cd2963b0 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_linux.cc
@@ -112,11 +112,11 @@ class PprofCodeObserver : public CodeObserver {
pprof_symbol_generator_->WriteToMemory(debug_region);
int buffer_size = debug_region->size();
void* buffer = debug_region->data();
- delete debug_region;
if (buffer_size > 0) {
ASSERT(buffer != NULL);
(*file_write)(buffer, buffer_size, out_file);
}
+ delete debug_region;
(*file_close)(out_file);
DebugInfo::UnregisterAllSections();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698