diff --git a/src/system/runtime_loader/elf_tls.cpp b/src/system/runtime_loader/elf_tls.cpp index 40bc66c006..f534cecc00 100644 --- a/src/system/runtime_loader/elf_tls.cpp +++ b/src/system/runtime_loader/elf_tls.cpp @@ -12,6 +12,8 @@ #include +#include + class TLSBlock { public: @@ -284,8 +286,12 @@ DynamicThreadVector::_ResizeVector(unsigned minimumSize) *fVector = (TLSBlock*)newVector; memset(*fVector + oldSize + 1, 0, (size - oldSize) * sizeof(TLSBlock)); - if (fGeneration == NULL) + if (fGeneration == NULL) { fGeneration = new Generation; + if (fGeneration == NULL) + return B_NO_MEMORY; + } + *(Generation**)*fVector = fGeneration; fGeneration->SetSize(size); diff --git a/src/system/runtime_loader/images.cpp b/src/system/runtime_loader/images.cpp index 15f39d280a..d851f9fd06 100644 --- a/src/system/runtime_loader/images.cpp +++ b/src/system/runtime_loader/images.cpp @@ -23,6 +23,8 @@ #include "elf_tls.h" #include "runtime_loader_private.h" +#include + // keep in sync with app ldscript #ifdef __x86_64__