From f1aa871d4d39dc7f6bcbd8cb77a9f54c6cbd2ae9 Mon Sep 17 00:00:00 2001 From: You Kim Date: Tue, 25 Dec 2012 23:51:01 +0900 Subject: [PATCH] DexDump: Leak in FieldMethodInfo.signature Free pMethInfo->signature when filled by getMethodInfo. Change-Id: Id278d732374daceb7b8b05be7f433af25eee0c27 --- dexdump/DexDump.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dexdump/DexDump.cpp b/dexdump/DexDump.cpp index 6ecf67168..0d7b42539 100644 --- a/dexdump/DexDump.cpp +++ b/dexdump/DexDump.cpp @@ -787,6 +787,7 @@ static char* indexString(DexFile* pDexFile, outSize = snprintf(buf, bufSize, "%s.%s:%s // method@%0*x", methInfo.classDescriptor, methInfo.name, methInfo.signature, width, index); + free((void *) methInfo.signature); } else { outSize = snprintf(buf, bufSize, " // method@%0*x", width, index); @@ -1069,6 +1070,7 @@ void dumpBytecodes(DexFile* pDexFile, const DexMethod* pDexMethod) printf("%06x: |[%06x] %s.%s:%s\n", startAddr, startAddr, className, methInfo.name, methInfo.signature); + free((void *) methInfo.signature); insnIdx = 0; while (insnIdx < (int) pCode->insnsSize) { -- 2.11.0