use-after-free bug in diff.c
garious opened this issue · 1 comments
garious commented
I'm seeing a use-after-free bug when accessing a Patch object after its Diff had been garbage-collected. Valgrind confirms.
The quick fix is to strdup() old_file.path and new_file.path (and free in Patch_dealloc). Better would be to skip the mallocs and piggyback the git_patch* onto the Patch object and move git_patch_free() to Patch_dealloc. Thoughts?
garious commented
Closing. Will return soon as a Pull Request!