diff --git a/src/common/memory_patcher.cpp b/src/common/memory_patcher.cpp index 5091bf1d9..0a74a45a5 100644 --- a/src/common/memory_patcher.cpp +++ b/src/common/memory_patcher.cpp @@ -423,7 +423,8 @@ void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valu std::vector payload; for (size_t i = 0; i < valueStr.length(); i += 2) { - const char* byteStr = valueStr.substr(i, 2).c_str(); + std::string tempStr = valueStr.substr(i, 2); + const char* byteStr = tempStr.c_str(); char* endPtr; unsigned int byteVal = std::strtoul(byteStr, &endPtr, 16);