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