Skip to content

config: Fix a leak parsing multi-line config entries#4792

Merged
pks-t merged 2 commits into
libgit2:masterfrom
nelhage:multiline-leak
Sep 6, 2018
Merged

config: Fix a leak parsing multi-line config entries#4792
pks-t merged 2 commits into
libgit2:masterfrom
nelhage:multiline-leak

Conversation

@nelhage
Copy link
Copy Markdown
Contributor

@nelhage nelhage commented Sep 1, 2018

No description provided.

nelhage and others added 2 commits September 1, 2018 03:50
The current error handling for the multiline variable parser is a bit
fragile, as each error condition has its own code to clear memory.
Instead, unify error handling as far as possible to avoid this
repetitive code. While at it, make use of `GITERR_CHECK_ALLOC` to
correctly handle OOM situations and verify that the buffer we print into
does not run out of memory either.
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Sep 3, 2018

I've amended this PR to improve the error handling of this function in general. It's much too frickle in my opinion. Please let me know if you're fine with those changes

Copy link
Copy Markdown
Contributor Author

@nelhage nelhage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@pks-t pks-t merged commit 695067f into libgit2:master Sep 6, 2018
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Sep 6, 2018

Thanks @nelhage and @tiennou, both for fixing the leak as well as the reviews!

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.

3 participants