The Wayback Machine - https://web.archive.org/web/20200916035834/https://github.com/libgit2/pygit2/pull/348
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

diff: Fix for memory leak in git_patch #348

Merged
merged 1 commit into from Feb 21, 2014
Merged

diff: Fix for memory leak in git_patch #348

merged 1 commit into from Feb 21, 2014

Conversation

@beeble
Copy link

beeble commented Feb 21, 2014

This pull request will fix a memory leak,
that occurs while iterating through patches.

It's quite major issue, my machine run out of memory in couple of minutes.
Please take a look at this fragment of valgrind log.
==6056== 154,660,050 (15,076,512 direct, 139,583,538 indirect) bytes in 52,349 blocks are definitely lost in loss record 788 of 788
==6056== at 0x4C2B590: calloc (vg_replace_malloc.c:618)
==6056== by 0x71159C6: git__calloc (util.h:36)
==6056== by 0x7115D97: diff_patch_alloc_from_diff (diff_patch.c:104)
==6056== by 0x711726A: git_patch_from_diff (diff_patch.c:622)
==6056== by 0x6ED71AF: diff_get_patch_byindex (diff.c:140)
==6056== by 0x55F1DA: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==6056== by 0x55F7B9: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==6056== by 0x55F7B9: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==6056== by 0x55F7B9: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==6056== by 0x55F7B9: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==6056== by 0x55F7B9: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==6056== by 0x55F7B9: PyEval_EvalFrameEx (in /usr/bin/python2.7)

@xtao
Copy link
Contributor

xtao commented Feb 21, 2014

👏

@jdavid jdavid merged commit 0e4a272 into libgit2:master Feb 21, 2014
1 check passed
1 check passed
default The Travis CI build passed
Details
@alexband
Copy link

alexband commented Feb 25, 2014

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.