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

Re: CVS update: subversion/subversion/libsvn_fs id.c

From: Ben Collins-Sussman <sussman_at_newton.ch.collab.net>
Date: 2001-02-28 00:52:59 CET

Uhhhhh, nope. apr_pcalloc was segfaulting on both me and Mike
(fs-test #5). Adding the malloc fixed this.

Maybe it's time to debug apr. :)

Jim Blandy <jimb@zwingli.cygnus.com> writes:

> This is unnecessary. apr_pcalloc behaves this way automatically
> whenever its pool argument is zero.
>
> sussman@tigris.org writes:
>
> >
> > User: sussman
> > Date: 01/02/27 14:58:08
> >
> > Modified: subversion/libsvn_fs id.c
> > Log:
> > (svn_fs_parse_id): bugfix: make this func use malloc if no pool is
> > given, as described in its documentation.
> >
> > Revision Changes Path
> > 1.16 +8 -1 subversion/subversion/libsvn_fs/id.c
> >
> > Index: id.c
> > ===================================================================
> > RCS file: /cvs/subversion/subversion/libsvn_fs/id.c,v
> > retrieving revision 1.15
> > retrieving revision 1.16
> > diff -u -r1.15 -r1.16
> > --- id.c 2001/02/12 00:26:14 1.15
> > +++ id.c 2001/02/27 22:58:08 1.16
> > @@ -191,7 +191,14 @@
> >
> > /* Allocate the ID array. Note that if pool is zero, apr_palloc
> > just calls malloc, which meets our promised interface. */
> > - id = apr_palloc (pool, sizeof (*id) * (id_len + 1));
> > + if (pool)
> > + id = apr_palloc (pool, sizeof (*id) * (id_len + 1));
> > + else
> > + {
> > + id = malloc (sizeof (*id) * (id_len + 1));
> > + if (! id)
> > + abort(); /* couldn't malloc */
> > + }
> >
> > {
> > int i = 0;
> >
> >
> >
> >
Received on Sat Oct 21 14:36:23 2006

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.