OSDN Git Service

Fix DDM reply buffer deallocation
authorSebastien Hertz <shertz@google.com>
Thu, 6 Aug 2015 09:37:02 +0000 (11:37 +0200)
committerSebastien Hertz <shertz@google.com>
Thu, 6 Aug 2015 09:38:32 +0000 (11:38 +0200)
Reply buffer is an uint8_t* allocated with new uint8_t[...] so it
must be deallocated with delete[], not free.

Change-Id: Ib5d6387aa63f1e0393113f82602f661bbada4aa2

runtime/jdwp/jdwp_handler.cc

index f449406..7776f8f 100644 (file)
@@ -1391,7 +1391,7 @@ static JdwpError DDM_Chunk(JdwpState* state, Request* request, ExpandBuf* pReply
     // heap requirements is probably more valuable than the efficiency.
     CHECK_GT(replyLen, 0);
     memcpy(expandBufAddSpace(pReply, replyLen), replyBuf, replyLen);
-    free(replyBuf);
+    delete[] replyBuf;
   }
   return ERR_NONE;
 }