OSDN Git Service

Fix a minor leaks caused by failed initializations.(typo)
authorYou Kim <you.kim72@gmail.com>
Tue, 2 Apr 2013 17:13:46 +0000 (02:13 +0900)
committerYou Kim <you.kim72@gmail.com>
Tue, 2 Apr 2013 17:13:46 +0000 (02:13 +0900)
Change-Id: I62bc3ea48938a4f54e9f47218d4025e954a6d566

vm/compiler/Compiler.cpp

index cdd62cc..188027f 100644 (file)
@@ -448,7 +448,7 @@ static bool compilerThreadStartup(void)
     pJitProfTable = (unsigned char *)malloc(JIT_PROF_SIZE);
     if (!pJitProfTable) {
         ALOGE("jit prof table allocation failed");
-        free(pJitProfTable);
+        free(pJitTable);
         dvmUnlockMutex(&gDvmJit.tableLock);
         goto fail;
     }
@@ -464,6 +464,8 @@ static bool compilerThreadStartup(void)
                              calloc(1, sizeof(*pJitTraceProfCounters));
     if (!pJitTraceProfCounters) {
         ALOGE("jit trace prof counters allocation failed");
+        free(pJitTable);
+        free(pJitProfTable);
         dvmUnlockMutex(&gDvmJit.tableLock);
         goto fail;
     }