[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: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-01-06 00:31:24 CET

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.

> if (rv)
> return svn_ra_dav__convert_error(ras->sess,
> "Lock request failed", rv, pool);
> @@ -980,22 +984,19 @@
> /* Build an svn_lock_t based on the returned ne_lock. */
> slock = apr_pcalloc(pool, sizeof(*slock));
> slock->path = fs_path.data;
> - slock->token = apr_pstrdup(pool, nlock->token);
> - if (nlock->owner)
> - slock->comment = apr_pstrdup(pool, nlock->owner);
> + slock->token = apr_pstrdup(pool, nlock.token);
> + if (nlock.owner)
> + slock->comment = apr_pstrdup(pool, nlock.owner);
> if (ras->auth_username)
> slock->owner = apr_pstrdup(pool, ras->auth_username);
> if (lrb->creation_date)
> slock->creation_date = lrb->creation_date;
>
> - if (nlock->timeout == NE_TIMEOUT_INFINITE)
> + if (nlock.timeout == NE_TIMEOUT_INFINITE)
> slock->expiration_date = 0;
> - else if (nlock->timeout > 0)
> + else if (nlock.timeout > 0)
> slock->expiration_date = slock->creation_date +
> - apr_time_from_sec(nlock->timeout);
> -
> - /* Free the neon lock struct. */
> - ne_lock_destroy(nlock);

Leak? Do you need to call ne_lock_free here?

> + apr_time_from_sec(nlock.timeout);
>
> *lock = slock;
> return SVN_NO_ERROR;

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jan 6 00:32:37 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.