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?
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.pathandnew_file.path(andfreeinPatch_dealloc). Better would be to skip the mallocs and piggyback thegit_patch*onto thePatchobject and movegit_patch_free()toPatch_dealloc. Thoughts?