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)
committerElliott Hughes <enh@google.com>
Tue, 2 Apr 2013 20:13:27 +0000 (13:13 -0700)
(cherry-pick of 8e622221809bf852b1063db00493475b77beefed.)

Change-Id: I0ec95058616e48dbc574c5d207b4576923a0cc37

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;
     }