Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use-after-free bug in diff.c #457

Closed
garious opened this issue Dec 6, 2014 · 1 comment
Closed

use-after-free bug in diff.c #457

garious opened this issue Dec 6, 2014 · 1 comment

Comments

@garious
Copy link
Contributor

garious commented Dec 6, 2014

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
Copy link
Contributor Author

garious commented Dec 19, 2014

Closing. Will return soon as a Pull Request!

@garious garious closed this as completed Dec 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant