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

Re: [PATCH] Fix pool usage in FSFS locking code

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 12 Feb 2015 13:32:58 +0000

Sergey Raevskiy <sergey.raevskiy_at_visualsvn.com> writes:

> Index: subversion/libsvn_fs_fs/lock.c
> ===================================================================
> --- subversion/libsvn_fs_fs/lock.c (revision 1659239)
> +++ subversion/libsvn_fs_fs/lock.c (working copy)
> @@ -900,14 +900,15 @@ lock_body(void *baton, apr_pool_t *pool)
> {
> info->lock = svn_lock_create(lb->result_pool);
> if (target->token)
> - info->lock->token = target->token;
> + info->lock->token = apr_pstrdup(lb->result_pool, target->token);
> else
> SVN_ERR(svn_fs_fs__generate_lock_token(&(info->lock->token), lb->fs,
> lb->result_pool));
>
> - info->lock->path = info->path;
> - info->lock->owner = lb->fs->access_ctx->username;
> - info->lock->comment = lb->comment;
> + info->lock->path = apr_pstrdup(lb->result_pool, info->path);
> + info->lock->owner = apr_pstrdup(lb->result_pool,
> + lb->fs->access_ctx->username);
> + info->lock->comment = apr_pstrdup(lb->result_pool, lb->comment);
> info->lock->is_dav_comment = lb->is_dav_comment;
> info->lock->creation_date = apr_time_now();
> info->lock->expiration_date = lb->expiration_date;

I think info->path is already in the correct pool, it's the result of
processing the the input path through svn_fspath__canonicalize using
result_pool.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2015-02-12 14:34:16 CET

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