summaryrefslogtreecommitdiff
path: root/diffcore-break.c
diff options
context:
space:
mode:
authorYasushi SHOJI <yashi@atmark-techno.com>2005-08-13 10:58:56 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-14 01:28:55 (GMT)
commit068eac91ce04b9aca163acb1927c3878c45d1a07 (patch)
tree87b828dfa09d9e6f700abee565b48613cf15d5c1 /diffcore-break.c
parente54c5ea93e0785dfd37fd9201797977a02ca0ddb (diff)
downloadgit-068eac91ce04b9aca163acb1927c3878c45d1a07.zip
git-068eac91ce04b9aca163acb1927c3878c45d1a07.tar.gz
git-068eac91ce04b9aca163acb1927c3878c45d1a07.tar.bz2
[PATCH] plug memory leak in diff.c::diff_free_filepair()
When I run git-diff-tree on big change, it seems the command eats so much memory. so I just put git under valgrind to see what's going on. diff_free_filespec_data() doesn't free diff_filespec itself. [jc: I ended up doing things slightly differently from Yasushi's patch. The original idea was to use free_filespec_data() only to free the data portion and keep useing the filespec itself, but no existing code seems to do things that way, so I just yanked that part out.] Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diffcore-break.c')
-rw-r--r--diffcore-break.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diffcore-break.c b/diffcore-break.c
index 06f9a7f..b0c8461 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -231,8 +231,8 @@ static void merge_broken(struct diff_filepair *p,
dp = diff_queue(outq, d->one, c->two);
dp->score = p->score;
- diff_free_filespec_data(d->two);
- diff_free_filespec_data(c->one);
+ diff_free_filespec(d->two);
+ diff_free_filespec(c->one);
free(d);
free(c);
}