From: Jonathan Nieder Date: Tue, 05 Oct 2010 02:11:33 GMT Subject: Re: [PATCH 2/6] Allow more than one keepfile in the transport Message-ID: <20101005021133.GB10818@burratino> In-Reply-To: <1286108511-55876-2-git-send-email-tom@dbservice.com> Tomas Carnecky wrote: > Use an array to keep track of the pack lockfiles. Should probably use a string_list (which is the same thing :)) to save some code. > --- a/transport-helper.c > +++ b/transport-helper.c > @@ -362,10 +362,7 @@ static int fetch_with_fetch(struct transport *transport, > > if (!prefixcmp(buf.buf, "lock ")) { > const char *name = buf.buf + 5; > - if (transport->pack_lockfile) > - warning("%s also locked %s", data->name, name); > - else > - transport->pack_lockfile = xstrdup(name); > + transport_keep(transport, name); Won't buf.buf be released before the lockfile needs to be read? So I suspect the strdup is necessary.