From: Stefan Beller <sbeller@google.com>
To: gitster@pobox.com, git@vger.kernel.org
Cc: Stefan Beller <sbeller@google.com>, tr@thomasrast.ch
Subject: [PATCH V2 2/6] line-log.c: fix a memleak
Date: Fri, 27 Mar 2015 15:32:45 -0700 [thread overview]
Message-ID: <1427495569-10863-3-git-send-email-sbeller@google.com> (raw)
In-Reply-To: <1427495569-10863-1-git-send-email-sbeller@google.com>
The `filepair` is assigned new memory with any iteration via
process_diff_filepair, so free it before the current iteration ends.
Signed-off-by: Stefan Beller <sbeller@google.com>
---
line-log.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/line-log.c b/line-log.c
index a490efe..b43ac58 100644
--- a/line-log.c
+++ b/line-log.c
@@ -1099,6 +1099,7 @@ static int process_all_files(struct line_log_data **range_out,
rg->pair = diff_filepair_dup(queue->queue[i]);
memcpy(&rg->diff, pairdiff, sizeof(struct diff_ranges));
}
+ free(pairdiff);
}
return changed;
--
2.3.0.81.gc37f363
next prev parent reply other threads:[~2015-03-27 22:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 22:32 [PATCH V2 0/6] Memory leaks once again Stefan Beller
2015-03-27 22:32 ` [PATCH V2 1/6] shallow: fix a memleak Stefan Beller
2015-03-27 23:01 ` Eric Sunshine
2015-03-27 22:32 ` Stefan Beller [this message]
2015-03-27 22:32 ` [PATCH V2 3/6] line-log.c: " Stefan Beller
2015-03-27 22:32 ` [PATCH V2 4/6] wt-status.c: " Stefan Beller
2015-03-27 23:16 ` Eric Sunshine
2015-03-27 22:32 ` [PATCH V2 5/6] pack-bitmap: " Stefan Beller
2015-03-27 23:27 ` Eric Sunshine
2015-03-31 3:29 ` Jeff King
2015-03-27 22:32 ` [PATCH V2 6/6] WIP/RFC/entry.c: " Stefan Beller
2015-03-27 23:32 ` Eric Sunshine
2015-03-28 0:14 ` Eric Sunshine
2015-03-28 11:09 ` John Keeping
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=1427495569-10863-3-git-send-email-sbeller@google.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tr@thomasrast.ch \
/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).