From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH 0/2] diff: fix a memory leak
Date: Fri, 4 Mar 2016 23:07:40 +0000 [thread overview]
Message-ID: <56DA153C.1060802@ramsayjones.plus.com> (raw)
A recent memory leak patch from Patrick, commit 4867f1184
("xdiff/xmerge: fix memory leak in xdl_merge", 23-02-2016),
reminded me that I had a similar patch lying around.
After checking that it wasn't the same one, I dusted it off, and
split it into these two patches.
One of the reasons for not sending it earlier was that it is
not very likely to happen (without very large files), and I had
to use the debugger to confirm the leak and the fix.
[If you want to do so yourself, then I suggest that you use
two files that actually have changes and do 'run --no-pager diff
--no-index file-1 file-2'. set breakpoints on xdl_prepare_env,
xdl_init_classifier, xdl_free_classifier, xdl_optimize_ctxs and
xdl_cleanup_records. You have to force xdl_cleanup_records to
return -1 to simulate an OOM. Since xdl_free_classifier does
not set the allocated fields to NULL, you have to make sure that
you do/don't hit that breakpoint before the return at line #304/305.]
Ramsay Jones (2):
xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits
xdiff/xprepare: fix a memory leak
xdiff/xprepare.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.7.0
reply other threads:[~2016-03-04 23:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56DA153C.1060802@ramsayjones.plus.com \
--to=ramsay@ramsayjones.plus.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).