Skip to content

Commit

Permalink
Fix mismatching allocation/deallocation in AutoPatcher/CreatePatch.cpp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
png85 committed Jul 8, 2014
1 parent 0ee42ed commit 4aefdfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DependentExtensions/Autopatcher/CreatePatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ int TestDiffInMemory(int argc,char *argv[])
fwrite(out,outSize,1,pf);
fclose(pf);

free(out);
delete[] out;
return res;
}

Expand Down

0 comments on commit 4aefdfa

Please sign in to comment.