Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2BE05C7C9 for ; Tue, 1 May 2012 03:03:03 +0000 (UTC) Received: (qmail 65049 invoked by uid 500); 1 May 2012 03:03:03 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 65005 invoked by uid 500); 1 May 2012 03:03:01 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 64983 invoked by uid 99); 1 May 2012 03:03:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 03:03:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gstein@gmail.com designates 209.85.220.171 as permitted sender) Received: from [209.85.220.171] (HELO mail-vx0-f171.google.com) (209.85.220.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 03:02:55 +0000 Received: by vcbfl15 with SMTP id fl15so5637590vcb.16 for ; Mon, 30 Apr 2012 20:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=S5RQkRNMYh7XaiZfJctc49rhkA0/AcNmCNgAWcRBd+g=; b=Bn3+61mM+KRwpOGwqok/qSGMTeblJi8YlpTQPMqefjMWwsBlcVlTsBozMRDxXcBEvj PH0YcwsDg8a980Tx8pCOx0Q6W0gC6NsV3TKLbco5bIreEk5L+3lTT2ScRVoFbIdpuFbb sG0shg4T7i9Fbybr6MN/scQrZZoBjwgp9/lDpN35vRyD3U3LnGeLQ1J7LrGjxl8u5xjF otpGgsoCV7Dj1jzoKAaqoSDF6gtIqnndpuSppIMZ2y1YdtP/TbPXxhLU4GYyhamOvFY+ q7RWqX1HqU6oH0jL3PLMp9OiG+aOMKfOiGELdhN+cFzXhC+/Qxab4IZ9rxS6LWUvvNhy 1xvA== MIME-Version: 1.0 Received: by 10.52.22.74 with SMTP id b10mr20019677vdf.47.1335841354100; Mon, 30 Apr 2012 20:02:34 -0700 (PDT) Received: by 10.220.179.77 with HTTP; Mon, 30 Apr 2012 20:02:33 -0700 (PDT) Received: by 10.220.179.77 with HTTP; Mon, 30 Apr 2012 20:02:33 -0700 (PDT) In-Reply-To: References: <20120428015036.16CF4238897D@eris.apache.org> Date: Mon, 30 Apr 2012 23:02:34 -0400 Message-ID: Subject: Re: svn commit: r1331652 - /subversion/trunk/subversion/libsvn_delta/compat.c From: Greg Stein To: dev@subversion.apache.org Cc: commits@subversion.apache.org Content-Type: multipart/alternative; boundary=20cf3077639f632e1e04bef0cd25 --20cf3077639f632e1e04bef0cd25 Content-Type: text/plain; charset=ISO-8859-1 On Apr 30, 2012 9:38 PM, "Hyrum K Wright" wrote: >... > > +/* Insert a new change for RELPATH, or return an existing one. */ > > +static struct change_node * > > +insert_change(const char *relpath, > > + apr_hash_t *changes) > > +{ > > + apr_pool_t *result_pool; > > + struct change_node *change; > > + > > + change = apr_hash_get(changes, relpath, APR_HASH_KEY_STRING); > > + if (change != NULL) > > + return change; > > + > > + result_pool = apr_hash_pool_get(changes); > > + > > + /* Return an empty change. Callers will tweak as needed. */ > > + change = apr_pcalloc(result_pool, sizeof(*change)); > > + change->changing = SVN_INVALID_REVNUM; > > + change->deleting = SVN_INVALID_REVNUM; > > + > > + apr_hash_set(changes, relpath, APR_HASH_KEY_STRING, change); > > As the key of the hash, RELPATH should be duplicated into a pool with > sufficient lifetime. Good catch! Fixed in r1332508. --20cf3077639f632e1e04bef0cd25 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Apr 30, 2012 9:38 PM, "Hyrum K Wright" <hyrum.wright@wandisco.com> wrote:
>...
> > +/* Insert a new change for RELPATH, or return an existing one. = =A0*/
> > +static struct change_node *
> > +insert_change(const char *relpath,
> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0apr_hash_t *changes)
> > +{
> > + =A0apr_pool_t *result_pool;
> > + =A0struct change_node *change;
> > +
> > + =A0change =3D apr_hash_get(changes, relpath, APR_HASH_KEY_STRIN= G);
> > + =A0if (change !=3D NULL)
> > + =A0 =A0return change;
> > +
> > + =A0result_pool =3D apr_hash_pool_get(changes);
> > +
> > + =A0/* Return an empty change. Callers will tweak as needed. =A0= */
> > + =A0change =3D apr_pcalloc(result_pool, sizeof(*change));
> > + =A0change->changing =3D SVN_INVALID_REVNUM;
> > + =A0change->deleting =3D SVN_INVALID_REVNUM;
> > +
> > + =A0apr_hash_set(changes, relpath, APR_HASH_KEY_STRING, change);=
>
> As the key of the hash, RELPATH should be duplicated into a pool with<= br> > sufficient lifetime.

Good catch! Fixed in r1332508.

--20cf3077639f632e1e04bef0cd25--