[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1331652 - /subversion/trunk/subversion/libsvn_delta/compat.c

From: Greg Stein <gstein_at_gmail.com>
Date: Mon, 30 Apr 2012 23:02:34 -0400

On Apr 30, 2012 9:38 PM, "Hyrum K Wright" <hyrum.wright_at_wandisco.com> 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.
Received on 2012-05-01 05:03:10 CEST

This is an archived mail posted to the Subversion Dev mailing list.