]> git.ipfire.org Git - thirdparty/git.git/commit
merge-ort: fix massive leak
authorElijah Newren <newren@gmail.com>
Sun, 24 Jan 2021 06:01:10 +0000 (22:01 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 Jan 2021 07:30:06 +0000 (23:30 -0800)
commitcf8937acdedc80e636587f5fc2f495ea38bd5fe0
tree341d785060fb62d6be8746a8b959ddd4488fb806
parentfe2f4d0031efea524163d63888c010fc6a8201e1
merge-ort: fix massive leak

When a series of merges was performed (such as for a rebase or series of
cherry-picks), only the data structures allocated by the final merge
operation were being freed.  The problem was that while picking out
pieces of merge-ort to upstream, I previously misread a certain section
of merge_start() and assumed it was associated with a later
optimization.  Include that section now, which ensures that if there was
a previous merge operation, that we clear out result->priv and then
re-use it for opt->priv, and otherwise we allocate opt->priv.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c