OSDN Git Service

Possible leak in dvmAllocRegion
authorYou Kim <you.kim72@gmail.com>
Mon, 17 Dec 2012 15:14:07 +0000 (00:14 +0900)
committerYou Kim <you.kim72@gmail.com>
Mon, 17 Dec 2012 15:14:07 +0000 (00:14 +0900)
In error case mmapped ptr 'base' is not munmapped.

Change-Id: I9e43841371fee6b7c092fe9a8922ae82e78805ed

vm/Misc.cpp

index 1f01c2f..057b90d 100644 (file)
@@ -624,6 +624,7 @@ void *dvmAllocRegion(size_t byteCount, int prot, const char *name) {
         return NULL;
     }
     if (ret == -1) {
+        munmap(base, byteCount);
         return NULL;
     }
     return base;