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; |
} |