diff --git a/src/nativestore/NodeBlock.cpp b/src/nativestore/NodeBlock.cpp index 78bb94e25..577a8ab4e 100644 --- a/src/nativestore/NodeBlock.cpp +++ b/src/nativestore/NodeBlock.cpp @@ -365,7 +365,10 @@ std::map NodeBlock::getAllProperties() { std::map allProperties; PropertyLink* current = this->getPropertyHead(); while (current) { - allProperties.insert({current->name, current->value}); + // don't forget to free the allocated memory after using this method + char* copiedValue = new char[PropertyLink::MAX_VALUE_SIZE]; + std::strncpy(copiedValue, current->value, PropertyLink::MAX_VALUE_SIZE); + allProperties.insert({current->name, copiedValue}); PropertyLink* temp = current->next(); delete current; // To prevent memory leaks current = temp;