Re: [PATCH 3/5] diff --color-moved-ws: fix a memory leak

2018-10-03 Thread Martin Ă…gren
On Tue, 2 Oct 2018 at 20:04, Phillip Wood wrote: > const struct emitted_diff_symbol *longer = a->len > b->len ? a : b; > const struct emitted_diff_symbol *shorter = a->len > b->len ? b : a; > int d = longer->len - shorter->len; > + int ret = !strncmp(longer->line +

Re: [PATCH 3/5] diff --color-moved-ws: fix a memory leak

2018-10-03 Thread Phillip Wood
On 02/10/2018 20:08, Stefan Beller wrote: > On Tue, Oct 2, 2018 at 10:55 AM Phillip Wood > wrote: >> >> From: Phillip Wood >> >> Don't duplicate the indentation string if we're not going to use it. >> This was found with asan. > > Makes sense, > > Thanks, > Stefan > > With compute_ws_delta

Re: [PATCH 3/5] diff --color-moved-ws: fix a memory leak

2018-10-02 Thread Stefan Beller
On Tue, Oct 2, 2018 at 10:55 AM Phillip Wood wrote: > > From: Phillip Wood > > Don't duplicate the indentation string if we're not going to use it. > This was found with asan. Makes sense, Thanks, Stefan With compute_ws_delta growing bigger here (and having only one caller), I wonder if we

[PATCH 3/5] diff --color-moved-ws: fix a memory leak

2018-10-02 Thread Phillip Wood
From: Phillip Wood Don't duplicate the indentation string if we're not going to use it. This was found with asan. Signed-off-by: Phillip Wood --- diff.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/diff.c b/diff.c index 0096bdc339..efadd05c90 100644 --- a/diff.c