git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] refs: release strbuf after use in check_refname_component()

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 29, 2014, 17:37 UTC
Message-ID
<xmqq387y1hnc.fsf@gitster.dls.corp.google.com>
In-Reply-To
<549A0665.6080207@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 18 quoted lines
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
>  refs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/refs.c b/refs.c
> index 5fcacc6..ed3b2cb 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
>  			struct strbuf err = STRBUF_INIT;
>  			unable_to_lock_message(ref_file, errno, &err);
>  			error("%s", err.buf);
> -			strbuf_reset(&err);
> +			strbuf_release(&err);
>  			goto error_return;
>  		}
>  	}

The subject does not seem to match what the patch is doing, but the patch is obviously correct ;-)

Previous: René ScharfeNext: Jeff King
Message 2 of 3 in “refs: release strbuf after use in check_refname_component()”
  1. refs: release strbuf after use in check_refname_component()René Scharfe, Dec 24, 2014
  2. Junio C HamanoDec 29, 2014
  3. Jeff KingDec 29, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.