Fix crash if no avian.boostrap is specified

This commit is contained in:
Alexey Pelykh 2013-01-31 22:06:35 +02:00
parent 9ed312451a
commit bde33c97f8

View File

@ -3008,7 +3008,8 @@ Machine::Machine(System* system, Heap* heap, Finder* bootFinder,
populateJNITables(&javaVMVTable, &jniEnvVTable);
const char* bootstrapProperty = strdup(findProperty(this, BOOTSTRAP_PROPERTY));
const char* bootstrapProperty = findProperty(this, BOOTSTRAP_PROPERTY);
const char* bootstrapPropertyDup = bootstrapProperty ? strdup(bootstrapProperty) : 0;
const char* bootstrapPropertyEnd = bootstrapProperty + (bootstrapProperty ? strlen(bootstrapProperty) : 0);
char* codeLibraryName = (char*)bootstrapProperty;
char* codeLibraryNameEnd = 0;
@ -3039,7 +3040,8 @@ Machine::Machine(System* system, Heap* heap, Finder* bootFinder,
libraries->setNext(additionalLibrary);
}
free((void*)bootstrapProperty);
if(bootstrapPropertyDup)
free((void*)bootstrapPropertyDup);
}
void