diff --git a/vm/ByteCodeTranslator/src/cn1_globals.m b/vm/ByteCodeTranslator/src/cn1_globals.m index 51ecc12ee9..ae0b3bb143 100644 --- a/vm/ByteCodeTranslator/src/cn1_globals.m +++ b/vm/ByteCodeTranslator/src/cn1_globals.m @@ -528,6 +528,10 @@ void placeObjectInHeapCollection(JAVA_OBJECT obj) { // the thread just died, mark its remaining resources void collectThreadResources(struct ThreadLocalData *current) { + if(threadStateData->utf8Buffer != 0) { + free(threadStateData->utf8Buffer); + threadStateData->utf8Buffer = 0; + } for(int heapTrav = 0 ; heapTrav < current->heapAllocationSize ; heapTrav++) { JAVA_OBJECT obj = (JAVA_OBJECT)current->pendingHeapAllocations[heapTrav]; if(obj) {