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

Re: [PATCH] builtin-commit: fix --signoff

From
Pierre Habouzit <madcoder@debian.org>
Date
Nov 10, 2007, 13:16 UTC
Message-ID
<20071110131656.GD25204@artemis.corp>
In-Reply-To
<7vr6iyo4ff.fsf@gitster.siamese.dyndns.org>
On Sat, Nov 10, 2007 at 09:06:28AM +0000, Junio C Hamano wrote:
Show 19 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> >  	if (signoff) {
> > ...
> > +		strbuf_init(&sob, 0);
> > +		strbuf_addstr(&sob, sign_off_header);
> > +		strbuf_addstr(&sob, git_committer_info(1));
> > +		p = strrchr(sob.buf, '>');
> > +		if (p)
> > +			strbuf_setlen(&sob, p + 1 - sob.buf);
> > +		strbuf_addch(&sob, '\n');
> > +
> > +		for (i = sb.len - 1; i > 0 && sb.buf[i - 1] != '\n'; i--)
> > +			; /* do nothing */
> > +		if (prefixcmp(sb.buf + i, sob.buf))
> > +			strbuf_addbuf(&sb, &sob);
> >  	}
> 
> At this point doesn't this leak sob.buf?
  It does, strbuf_addbuf copies `sob` but doesn't release resources.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 5 in “builtin-commit: fix --signoff”
  1. builtin-commit: fix --signoffJohannes Schindelin, Nov 10, 2007
  2. Junio C HamanoNov 10, 2007
  3. Pierre HabouzitNov 10, 2007
  4. Johannes SchindelinNov 10, 2007
  5. builtin-commit: fix --signoffJohannes Schindelin, Nov 10, 2007

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.