diff: Fix for memory leak in git_patch