mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
Fixing property copying
This commit is contained in:
parent
6e3b170393
commit
5828ef1d46
@ -3155,14 +3155,6 @@ Machine::Machine(System* system, Heap* heap, Finder* bootFinder,
|
||||
|
||||
populateJNITables(&javaVMVTable, &jniEnvVTable);
|
||||
|
||||
const char* bootstrapProperty = findProperty(this, BOOTSTRAP_PROPERTY);
|
||||
const char* bootstrapPropertyDup = bootstrapProperty ? strdup(bootstrapProperty) : 0;
|
||||
const char* bootstrapPropertyEnd = bootstrapPropertyDup + (bootstrapPropertyDup ? strlen(bootstrapPropertyDup) : 0);
|
||||
char* codeLibraryName = (char*)bootstrapPropertyDup;
|
||||
char* codeLibraryNameEnd = 0;
|
||||
if (codeLibraryName && (codeLibraryNameEnd = strchr(codeLibraryName, system->pathSeparator())))
|
||||
*codeLibraryNameEnd = 0;
|
||||
|
||||
// Copying the properties memory (to avoid memory crashes)
|
||||
this->properties = (char**)heap->allocate(sizeof(char*) * propertyCount);
|
||||
for (unsigned int i = 0; i < propertyCount; i++)
|
||||
@ -3171,6 +3163,14 @@ Machine::Machine(System* system, Heap* heap, Finder* bootFinder,
|
||||
strcpy(this->properties[i], properties[i]);
|
||||
}
|
||||
|
||||
const char* bootstrapProperty = findProperty(this, BOOTSTRAP_PROPERTY);
|
||||
const char* bootstrapPropertyDup = bootstrapProperty ? strdup(bootstrapProperty) : 0;
|
||||
const char* bootstrapPropertyEnd = bootstrapPropertyDup + (bootstrapPropertyDup ? strlen(bootstrapPropertyDup) : 0);
|
||||
char* codeLibraryName = (char*)bootstrapPropertyDup;
|
||||
char* codeLibraryNameEnd = 0;
|
||||
if (codeLibraryName && (codeLibraryNameEnd = strchr(codeLibraryName, system->pathSeparator())))
|
||||
*codeLibraryNameEnd = 0;
|
||||
|
||||
if (not system->success(system->make(&localThread)) or
|
||||
not system->success(system->make(&stateLock)) or
|
||||
not system->success(system->make(&heapLock)) or
|
||||
|
Loading…
Reference in New Issue
Block a user