Re: [PATCH 07/18] avoid using fixed PATH_MAX buffers for refs
- From
Jeff King <peff@peff.net>
- Date
- Apr 18, 2017, 03:18 UTC
- Message-ID
- <20170418031812.lsi4v5tmxdfuglgo@sigill.intra.peff.net>
- In-Reply-To
- <xmqq1ssrk1za.fsf@gitster.mtv.corp.google.com>
On Sun, Apr 16, 2017 at 11:00:25PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> > diff --git a/builtin/replace.c b/builtin/replace.c > > index f83e7b8fc..065515bab 100644 > > --- a/builtin/replace.c > > +++ b/builtin/replace.c > > @@ -93,26 +93,31 @@ typedef int (*each_replace_name_fn)(const char *name, const char *ref, > > static int for_each_replace_name(const char **argv, each_replace_name_fn fn) > [...] > > Don't we need to strbuf_release(&ref) before leaving this function?
Yes, good catch. Squashable patch is below.
I'm not sure how I missed that one. I double-checked the other hunks in the patch and they are all fine.
diff --git a/builtin/replace.c b/builtin/replace.c index 065515bab..ab17668f4 100644 --- a/builtin/replace.c +++ b/builtin/replace.c @@ -120,6 +120,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn) if (fn(full_hex, ref.buf, &oid)) had_error = 1; } + strbuf_release(&ref); return had_error; }