From: Sebastien Hertz Date: Thu, 6 Aug 2015 09:37:02 +0000 (+0200) Subject: Fix DDM reply buffer deallocation X-Git-Tag: android-x86-7.1-r1~889^2~610^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3901bbc170b73b13aa5092f5709a495a1847198f;p=android-x86%2Fart.git Fix DDM reply buffer deallocation Reply buffer is an uint8_t* allocated with new uint8_t[...] so it must be deallocated with delete[], not free. Change-Id: Ib5d6387aa63f1e0393113f82602f661bbada4aa2 --- diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc index f449406d1..7776f8fad 100644 --- a/runtime/jdwp/jdwp_handler.cc +++ b/runtime/jdwp/jdwp_handler.cc @@ -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; }