1
0
mirror of https://github.com/git/git synced 2024-07-02 15:48:44 +00:00
git/xdiff
Phillip Wood 9df0fc3d57 xdiff: fix a memory leak
Although the patience and histogram algorithms initialize the
environment they do not free it if there is an error. In contrast for
the Myers algorithm the environment is initalized in xdl_do_diff() and
it is freed if there is an error. Fix this by always initializing the
environment in xdl_do_diff() and freeing it there if there is an
error. Remove the comment in do_patience_diff() about the environment
being freed by xdl_diff() as it is not accurate because (a) xdl_diff()
does not do that if there is an error and (b) xdl_diff() is not the
only caller.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-16 10:58:05 -08:00
..
xdiff.h xdiff: implement a zealous diff3, or "zdiff3" 2021-12-01 14:45:58 -08:00
xdiffi.c xdiff: fix a memory leak 2022-02-16 10:58:05 -08:00
xdiffi.h Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
xemit.c xdiff-interface: replace discard_hunk_line() with a flag 2021-05-11 12:47:31 +09:00
xemit.h Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
xhistogram.c xdiff: fix a memory leak 2022-02-16 10:58:05 -08:00
xinclude.h xdiff: use git-compat-util 2019-04-12 13:34:17 +09:00
xmacros.h Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
xmerge.c xdiff: implement a zealous diff3, or "zdiff3" 2021-12-01 14:45:58 -08:00
xpatience.c xdiff: fix a memory leak 2022-02-16 10:58:05 -08:00
xprepare.c xdiff: avoid unnecessary memory allocations 2021-11-18 22:23:45 -08:00
xprepare.h Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
xtypes.h Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00
xutils.c xdiff: drop system includes in xutils.c 2019-07-28 21:51:19 -07:00
xutils.h Replace Free Software Foundation address in license notices 2017-11-09 13:21:21 +09:00