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

RE: svn commit: r1326614 - /subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Mon, 16 Apr 2012 15:51:22 +0200

> -----Original Message-----
> From: stefan2_at_apache.org [mailto:stefan2_at_apache.org]
> Sent: maandag 16 april 2012 15:46
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1326614 -
> /subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c
>
> Author: stefan2
> Date: Mon Apr 16 13:46:04 2012
> New Revision: 1326614
>
> URL: http://svn.apache.org/viewvc?rev=1326614&view=rev
> Log:
> Fix error passing when the shared memory cannot be opened.
> This caused uninitialized namespace objects to be used.
>
> * subversion/libsvn_subr/svn_named_atomic.c
> (unlock): pass the outer error through if it is not NULL
>
> Modified:
> subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c
>
> Modified: subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/svn_na
> med_atomic.c?rev=1326614&r1=1326613&r2=1326614&view=diff
> =================================================================
> =============
> --- subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c Mon Apr 16
> 13:46:04 2012
> @@ -282,8 +282,8 @@ lock(void)
> static svn_error_t *
> unlock(svn_error_t * outer_err)
> {
> - return svn_mutex__unlock(mutex,
> - svn_io_unlock_open_file(lock_file, mutex_pool));
> + svn_error_t *unlock_err = svn_io_unlock_open_file(lock_file, mutex_pool);
> + return svn_mutex__unlock(mutex, outer_err ? outer_err : unlock_err);

This potentially leaks an error. Why don't you use svn_error_compose_create()?

        Bert
Received on 2012-04-16 15:52:02 CEST

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.