Fix some leaks in the syncchannel unittest.

TBR=darin

Review URL: http://codereview.chromium.org/8170

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3963 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/common/ipc_sync_channel_unittest.cc b/chrome/common/ipc_sync_channel_unittest.cc
index decd6b6..1d28b06 100644
--- a/chrome/common/ipc_sync_channel_unittest.cc
+++ b/chrome/common/ipc_sync_channel_unittest.cc
@@ -484,7 +484,9 @@
       msg->EnableMessagePumping();
     bool result = Send(msg);
     DCHECK(result != close_channel_);
-    if (!close_channel_) {
+    if (close_channel_) {
+      delete reply_msg;
+    } else {
       SyncChannelTestMsg_Double::WriteReplyParams(reply_msg, in * 2);
       Send(reply_msg);
     }
@@ -493,6 +495,7 @@
 
   void OnAnswerDelay(Message* reply_msg) {
     if (close_channel_) {
+      delete reply_msg;
       CloseChannel();
     } else {
       SyncChannelTestMsg_AnswerToLife::WriteReplyParams(reply_msg, 42);