From 9019971faf72c36c98da5acd1148ff2caecf6cd0 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Fri, 4 Oct 2019 21:11:05 +1000 Subject: [PATCH] ShaderPatch: free old buffer when replacing data --- source-code/source/plugins/ShaderPatch/src/dllmain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source-code/source/plugins/ShaderPatch/src/dllmain.cpp b/source-code/source/plugins/ShaderPatch/src/dllmain.cpp index 91bf6ae..ad9d488 100644 --- a/source-code/source/plugins/ShaderPatch/src/dllmain.cpp +++ b/source-code/source/plugins/ShaderPatch/src/dllmain.cpp @@ -217,6 +217,7 @@ void hookedLoadFromFarcThunk(FArchivedFile** ppFile) if (modifiedStr.length() > 0) { + free(file.data); file.data = _strdup(modifiedStr.c_str()); file.dataSize = modifiedStr.size(); printf("[ShaderPatch] Patched %s\n", file.fileName.GetCharBuf());