Skip to content

open:fix memory leak when passing NULL to git_repository_open_ext#5224

Merged
ethomson merged 2 commits intolibgit2:masterfrom
lrm29:check_if_repository_memory_leak
Sep 11, 2019
Merged

open:fix memory leak when passing NULL to git_repository_open_ext#5224
ethomson merged 2 commits intolibgit2:masterfrom
lrm29:check_if_repository_memory_leak

Conversation

@lrm29
Copy link
Copy Markdown
Contributor

@lrm29 lrm29 commented Sep 10, 2019

There is an example on the website for checking if a directory looks like a repository:

https://libgit2.org/docs/guides/101-samples/#repositories_openable

This example leaks memory. This pull request includes a test point which leaks memory and is caught by valgrind, plus a fix in git_repository_open_ext to dispose of buffers on the early return.

Loading
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.

5 participants