From: Jonathan Tan Date: Fri, 19 May 2017 19:34:57 GMT Subject: Re: [PATCHv3 20/20] diff.c: color moved lines differently Message-ID: In-Reply-To: On Fri, May 19, 2017 at 11:40 AM, Stefan Beller wrote: >>> +static unsigned get_line_hash(struct buffered_patch_line *line, unsigned ignore_ws) >>> +{ >>> + static struct strbuf sb = STRBUF_INIT; >>> + >>> + if (ignore_ws) { >>> + strbuf_reset(&sb); >>> + get_ws_cleaned_string(line, &sb); >> >> Memory leak here, I think. > > It's static, so we don't care. > I can make it non-static and release the memory in a resend. Ah, I missed the "static". It seems that "static" is used elsewhere too, so these functions are not reentrant anyway, so this is fine.