From 4aefdfafd0b8b436f54a0e5b554648aa95d26987 Mon Sep 17 00:00:00 2001 From: "Peter Hille (png!das-system)" Date: Tue, 8 Jul 2014 22:39:16 +0200 Subject: [PATCH] Fix mismatching allocation/deallocation in AutoPatcher/CreatePatch.cpp This commit fixes a mismatching allocation/deallocation of a char array in the AutoPatcher code: CreatePatch.cpp:529: *out = new char[*outSize]; CreatePatch.cpp:579: free(out); Mixing up new/delete and malloc/free is undefined behaviour and should be avoided. --- DependentExtensions/Autopatcher/CreatePatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DependentExtensions/Autopatcher/CreatePatch.cpp b/DependentExtensions/Autopatcher/CreatePatch.cpp index 7811d98ed..be135ac03 100644 --- a/DependentExtensions/Autopatcher/CreatePatch.cpp +++ b/DependentExtensions/Autopatcher/CreatePatch.cpp @@ -576,7 +576,7 @@ int TestDiffInMemory(int argc,char *argv[]) fwrite(out,outSize,1,pf); fclose(pf); - free(out); + delete[] out; return res; }