git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>,
	Mariano Ortega <mgo1977@gmail.com>
Subject: Re: [PATCH 1/3 v2] Add support for external programs for handling  native fetches
Date: Tue, 28 Jul 2009 10:07:18 +0200	[thread overview]
Message-ID: <36ca99e90907280107i7afb7c64tf0c49bdf82e1e7cb@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.0907280155390.2147@iabervon.org>

On Tue, Jul 28, 2009 at 08:08, Daniel Barkalow<barkalow@iabervon.org> wrote:
> +static struct child_process *get_shim(struct transport *transport)
> +{
> +       struct shim_data *data = transport->data;
> +       if (!data->shim) {
> +               struct strbuf buf = STRBUF_INIT;
> +               struct child_process *shim = xcalloc(1, sizeof(*shim));
> +               shim->in = -1;
> +               shim->out = -1;
> +               shim->err = 0;
> +               shim->argv = xcalloc(4, sizeof(*shim->argv));
> +               strbuf_addf(&buf, "shim-%s", data->name);
> +               shim->argv[0] = buf.buf;
> +               shim->argv[1] = transport->remote->name;
> +               shim->argv[2] = transport->url;
> +               shim->git_cmd = 1;
> +               start_command(shim);
> +               data->shim = shim;
> +       }
> +       return data->shim;
> +}
> +
> +static int disconnect_shim(struct transport *transport)
> +{
> +       struct shim_data *data = transport->data;
> +       if (data->shim) {
> +               write(data->shim->in, "\n", 1);
> +               close(data->shim->in);
> +               finish_command(data->shim);
> +               free(data->shim->argv);
Does this leak data->shim->argv[0] (Ie "shim-%s")?

Bert
> +               free(data->shim);
> +               transport->data = NULL;
> +       }
> +       return 0;
> +}

  reply	other threads:[~2009-07-28  8:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28  6:08 [PATCH 1/3 v2] Add support for external programs for handling native fetches Daniel Barkalow
2009-07-28  8:07 ` Bert Wesarg [this message]
2009-07-28 15:25   ` Daniel Barkalow
2009-07-28 13:04 ` Johannes Schindelin
2009-07-28 17:38   ` Daniel Barkalow
2009-07-29 22:02     ` 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=36ca99e90907280107i7afb7c64tf0c49bdf82e1e7cb@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mgo1977@gmail.com \
    --cc=spearce@spearce.org \
    /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).