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

RE: svn commit: r1786446 - /subversion/trunk/subversion/libsvn_fs_fs/transaction.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Mon, 20 Mar 2017 17:22:06 +0100

> -----Original Message-----
> From: stefan2_at_apache.org [mailto:stefan2_at_apache.org]
> Sent: vrijdag 10 maart 2017 21:57
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1786446 -
> /subversion/trunk/subversion/libsvn_fs_fs/transaction.c
>
> Author: stefan2
> Date: Fri Mar 10 20:56:59 2017
> New Revision: 1786446
>
> URL: http://svn.apache.org/viewvc?rev=1786446&view=rev
> Log:
> * subversion/libsvn_fs_fs/transaction.c
> (get_shared_rep): Don't leak error objects.
>
> Found by: danielsh
>
> Modified:
> subversion/trunk/subversion/libsvn_fs_fs/transaction.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tra
> nsaction.c?rev=1786446&r1=1786445&r2=1786446&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Fri Mar 10
> 20:56:59 2017
> @@ -2429,9 +2429,6 @@ get_shared_rep(representation_t **old_re
> err = svn_stream_contents_same2(&same, contents, old_contents,
> scratch_pool);
>
> - /* Restore FILE's read / write position. */
> - SVN_ERR(svn_io_file_seek(file, APR_SET, &old_position, scratch_pool));
> -
> /* A mismatch should be extremely rare.
> * If it does happen, log the event and don't share the rep. */
> if (!same || err)
> @@ -2462,6 +2459,9 @@ get_shared_rep(representation_t **old_re
> svn_error_clear(err);
> *old_rep = NULL;
> }
> +
> + /* Restore FILE's read / write position. */
> + SVN_ERR(svn_io_file_seek(file, APR_SET, &old_position, scratch_pool));

I'm not sure if that is a safe fix... Need more context for that.
You could just have used svn_error_compose_create() and combine both errors.

        Bert
Received on 2017-03-20 17:28:21 CET

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