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

Re: [Patch] Issue #2291 - 'svn ls -v' should return locking information - V7

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-08-10 15:53:33 CEST

Another clarification... (Not a full review, this just caught my
attention.)

On Wed, 10 Aug 2005, Ben Collins-Sussman wrote:

>
> On Aug 9, 2005, at 6:15 PM, Alexander Thomas wrote:
>
>
> > + /* Get lock. */
> > + SVN_ERR (svn_ra_get_locks (ra_session, locks, "", subpool));
> > +

Note which pool is used.

> > + new_locks = apr_hash_make (pool);
> > + for (hi = apr_hash_first (subpool, *locks);
> > + hi;
> > + hi = apr_hash_next (hi))
> > + {
> > + const void *key;
> > + void *val;
> > + const char *newkey;
> > +
> > + apr_hash_this (hi, &key, NULL, &val);
> > + newkey = svn_path_is_child (svn_path_canonicalize (rel_path,
> > subpool),
> > + svn_path_canonicalize (key,
> > subpool),
> > + pool);
> > + if (newkey)
> > + apr_hash_set (new_locks, newkey, APR_HASH_KEY_STRING, val);

Woops! The lock is allocated in subpool, so it will be invalid, if not
before, a the end of the function. apr_hash_set just sets a pointer, it
does not move the data pointed to.

I'm sure Ben will take care of this as well, I just wanted to let you know
for the future, alexander.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 10 15:54:28 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.