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

Re: PATCH: error leaks

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2004-03-07 23:40:33 CET

Julian Foad <julianfoad@btopenworld.com> writes:

> Index: subversion/libsvn_fs/fs.c
> ===================================================================
> --- subversion/libsvn_fs/fs.c (revision 8913)
> +++ subversion/libsvn_fs/fs.c (working copy)
> @@ -582,7 +582,7 @@ svn_fs_create_berkeley (svn_fs_t *fs, co
> return SVN_NO_ERROR;
> error:
> - (void) cleanup_fs (fs);
> + svn_error_clear (cleanup_fs (fs));

Your change is OK, but there is an SVN_ERR in the function that could
bypass the error: label. I really think Subversion should avoid this
particular goto construct as it's too easy to introduce an SVN_ERR,
but that doesn't mean you should not apply your patch.

> return svn_err;
> }
> @@ -654,7 +654,7 @@ svn_fs_open_berkeley (svn_fs_t *fs, cons
> return SVN_NO_ERROR;
> error:
> - cleanup_fs (fs);
> + svn_error_clear (cleanup_fs (fs));

ditto

> return svn_err;
> }

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Mar 7 23:40:54 2004

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.