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

Re: RFOHE: issue #1601 patch for review

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-12-12 00:23:17 CET

kfogel@collab.net writes:

> Index: subversion/libsvn_ra_local/ra_plugin.c
> ===================================================================
> --- subversion/libsvn_ra_local/ra_plugin.c (revision 7978)
> +++ subversion/libsvn_ra_local/ra_plugin.c (working copy)

> +/* This implements 'svn_commit_callback_t'. Its invokes the original
> + (wrapped) callback, but also does deltification on the new revision.
> + BATON is 'struct deltify_etc_baton *'. */
> +static svn_error_t *
> +deltify_etc (svn_revnum_t new_revision,
> + const char *date,
> + const char *author,
> + void *baton)
> +{
> + struct deltify_etc_baton *db = baton;
> + svn_error_t *err1, *err2;
> +
> + /* Invoke the original callback first, in case someone's waiting to
> + know the revision number so they can go off and annotate an
> + issue or something. */
> + err1 = (*db->callback) (new_revision, date, author, db->callback_baton);
> + err2 = svn_fs_deltify_revision (db->fs, new_revision, db->pool);
> +
> + /* It's more interesting if the original callback failed, so let
> + that dominate. */
> + if (err1)
> + return err1;

The return above leaks err2

> +
> + return err2;
> +}

> Index: subversion/mod_dav_svn/version.c
> ===================================================================
> --- subversion/mod_dav_svn/version.c (revision 7978)
> +++ subversion/mod_dav_svn/version.c (working copy)

> +static apr_status_t cleanup_deltify(void *data)
> +{
> + struct cleanup_deltify_baton *cdb = data;
> + svn_repos_t *repos;
> + svn_error_t *err;
> +
> + /* Yes, opening a repository registers a cleanup on the pool from
> + which we are already running as a cleanup. But these days that's
> + safe. A big +smooch+ to Sander Striker -- I'm not sure it was
> + he who implemented this, but he told me about it anyway :-). */
> + err = svn_repos_open(&repos, cdb->repos_path, cdb->pool);
> + if (err)
> + {
> + ap_log_perror(APLOG_MARK, APLOG_ERR, err->apr_err, cdb->pool,
> + "cleanup_deltify: error opening repository '%s'",
> + cdb->repos_path);
> + return APR_SUCCESS;

leaks err

> + }
> +
> + err = svn_fs_deltify_revision(svn_repos_fs(repos),
> + cdb->revision, cdb->pool);
> + if (err)
> + {
> + ap_log_perror(APLOG_MARK, APLOG_ERR, err->apr_err, cdb->pool,
> + "cleanup_deltify: error deltifying against revision %"
> + SVN_REVNUM_T_FMT " in repository '%s'",
> + cdb->revision, cdb->repos_path);

ditto

> + }
> +
> + return APR_SUCCESS;
> +}

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 12 00:24:37 2003

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