git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Habouzit <madcoder@debian.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org, krh@redhat.com
Subject: Re: [PATCH] builtin-commit: fix --signoff
Date: Sat, 10 Nov 2007 14:16:56 +0100	[thread overview]
Message-ID: <20071110131656.GD25204@artemis.corp> (raw)
In-Reply-To: <7vr6iyo4ff.fsf@gitster.siamese.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

On Sat, Nov 10, 2007 at 09:06:28AM +0000, Junio C Hamano wrote:
> 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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-11-10 13:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-10  5:49 [PATCH] builtin-commit: fix --signoff Johannes Schindelin
2007-11-10  9:06 ` Junio C Hamano
2007-11-10 13:16   ` Pierre Habouzit [this message]
2007-11-10 13:47   ` Johannes Schindelin
2007-11-10 15:58     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071110131656.GD25204@artemis.corp \
    --to=madcoder@debian.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=krh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).