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

Re: svn commit: r12604 - in branches/locking/subversion: libsvn_ra_dav mod_dav_svn

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-01-06 01:55:35 CET

On Jan 5, 2005, at 5:31 PM, Philip Martin wrote:

> sussman@tigris.org writes:
>
>> Author: sussman
>> Date: Wed Jan 5 16:51:07 2005
>> New Revision: 12604
>
>> + /* Fill the neon lock structure. */
>> + nlock.owner = ne_strdup(comment);
>
> malloc
>
>> + if ((rv = ne_uri_parse(url, &(nlock.uri))))
>> return svn_ra_dav__convert_error(ras->sess, "Failed to parse
>> URI",
>> rv, pool);
>>
>> /* Issue LOCK request. */
>> - rv = ne_lock(ras->sess, nlock);
>> + rv = ne_lock(ras->sess, &nlock);
>
> Might free and replace with another malloc.

Take a look at the implementation of ne_lock(), as well as its
docstring.

It turns out that it's *required* that nlock.owner be malloc'd, because
ne_lock() calles NE_FREE() on that field! I was getting double-free
errors from libc until I made this change.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jan 6 01:56:49 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.