Skip to content

diff_parse: free object instead of its pointer#4215

Merged
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/diff-stack-free
Apr 25, 2017
Merged

diff_parse: free object instead of its pointer#4215
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/diff-stack-free

Conversation

@pks-t
Copy link
Copy Markdown
Member

@pks-t pks-t commented Apr 25, 2017

In e733001 (diff_parse: check return value of git_diff_init_options,
2017-03-20), we've introduced an error check whether we're able to
correctly initialize the diff options. This simple commit actually
introduced a segfault in that we now try to free the pointer to the
allocated diff in an error case, instead of the allocated diff itself.
This commit fixes the issue.

Kind of embarrassing... 💦

In e733001 (diff_parse: check return value of `git_diff_init_options`,
2017-03-20), we've introduced an error check whether we're able to
correctly initialize the diff options. This simple commit actually
introduced a segfault in that we now try to free the pointer to the
allocated diff in an error case, instead of the allocated diff itself.
This commit fixes the issue.
@ethomson ethomson merged commit 7f75eea into libgit2:master Apr 25, 2017
@pks-t pks-t deleted the pks/diff-stack-free branch April 28, 2017 11:07
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

Successfully merging this pull request may close these issues.

2 participants