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

Unified Diff: runtime/vm/service_test.cc

Issue 2629413003: Fix memory leak in ServiceTestMessageHandler. (Closed)
Patch Set: Created 3 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 | « runtime/tests/vm/vm.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_test.cc
diff --git a/runtime/vm/service_test.cc b/runtime/vm/service_test.cc
index 0bbed746f6b22d6367c3cbcbc4050674db2287d5..d0d488ab6f6090b49d64c6c16b818cbf8eff3570 100644
--- a/runtime/vm/service_test.cc
+++ b/runtime/vm/service_test.cc
@@ -33,6 +33,7 @@ class ServiceTestMessageHandler : public MessageHandler {
MessageStatus HandleMessage(Message* message) {
if (_msg != NULL) {
free(_msg);
+ _msg = NULL;
}
// Parse the message.
@@ -58,6 +59,8 @@ class ServiceTestMessageHandler : public MessageHandler {
_msg = strdup(reinterpret_cast<char*>(response.DataAddr(0)));
}
+ delete message;
+
return kOK;
}
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698