diff --color-moved-ws: fix another memory leak
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Thu, 4 Oct 2018 10:07:44 +0000 (11:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Oct 2018 05:48:17 +0000 (22:48 -0700)
This is obvious in retrospect, it was found with asan.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c

diff --git a/diff.c b/diff.c
index 38f2609..e0ebddf 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -994,6 +994,8 @@ static void pmb_advance_or_null_multi_match(struct diff_options *o,
                        moved_block_clear(&pmb[i]);
                }
        }
                        moved_block_clear(&pmb[i]);
                }
        }
+
+       free(got_match);
 }
 
 static int shrink_potential_moved_blocks(struct moved_block *pmb,
 }
 
 static int shrink_potential_moved_blocks(struct moved_block *pmb,