From 3901bbc170b73b13aa5092f5709a495a1847198f Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Thu, 6 Aug 2015 11:37:02 +0200 Subject: [PATCH] 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 --- runtime/jdwp/jdwp_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.11.0