Re: [patch] possible memory leak in diff.c::diff_free_filepair()

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [patch] possible memory leak in diff.c::diff_free_filepair()

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:04

Yasushi SHOJI [off-list ref] writes:
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.  is this
because in merge_broken() filespec itself is used but fliespec data
need to be freed?
Thanks for the patch.  I am wondering if the same leak exists in
diff_free_filepair(), which frees the filespec data without
freeing filespec itself for both sides.  If this is something
you can trap easily with valgrind I would really appreciate it.

Re: [patch] possible memory leak in diff.c::diff_free_filepair()

From: Yasushi SHOJI <hidden>
Date: 2016-06-15 22:42:04

At Sat, 13 Aug 2005 12:30:59 -0700,
Junio C Hamano wrote:
Yasushi SHOJI [off-list ref] writes:
quoted
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.  is this
because in merge_broken() filespec itself is used but fliespec data
need to be freed?
Thanks for the patch.  I am wondering if the same leak exists in
diff_free_filepair(), which frees the filespec data without
freeing filespec itself for both sides.  If this is something
you can trap easily with valgrind I would really appreciate it.
oops.  probably my english wasn't clear. my patch fixes
diff_free_filepair().

the reason I asked about merge_broken() was that those two functions
are the only functions calling diff_free_filespec_data(). it's first
time reading git source code and still learning ;)
--
          yashi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help