subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1663246 - /subversion/trunk/subversion/libsvn_fs/editor.c
Date Mon, 02 Mar 2015 10:40:37 GMT
Author: rhuijben
Date: Mon Mar  2 10:40:37 2015
New Revision: 1663246

URL: http://svn.apache.org/r1663246
Log:
Fix another valid compiler warning, by making an error code path more explicit.

* subversion/libsvn_fs/editor.c
  (svn_fs__editor_commit): Don't process errors from svn_editor_complete() as if
     they originate from svn_fs_commit_txn() to avoid accessing variables
     (/state) that wasn't set.

Modified:
    subversion/trunk/subversion/libsvn_fs/editor.c

Modified: subversion/trunk/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/editor.c?rev=1663246&r1=1663245&r2=1663246&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/editor.c (original)
+++ subversion/trunk/subversion/libsvn_fs/editor.c Mon Mar  2 10:40:37 2015
@@ -777,16 +777,24 @@ svn_fs__editor_commit(svn_revnum_t *revi
   /* Clean up internal resources (eg. eb->root). This also allows the
      editor infrastructure to know this editor is "complete".  */
   err = svn_editor_complete(editor);
+  if (err)
+    {
+      svn_fs_txn_t *txn = eb->txn;
+
+      eb->txn = NULL;
+      return svn_error_trace(svn_error_compose_create(
+                  err,
+                  svn_fs_abort_txn(txn, scratch_pool)));
+    }
 
   /* Note: docco for svn_fs_commit_txn() states that CONFLICT_PATH will
      be allocated in the txn's pool. But it lies. Regardless, we want
      it placed into RESULT_POOL.  */
 
-  if (!err)
-    err = svn_fs_commit_txn(&inner_conflict_path,
-                             revision,
-                             eb->txn,
-                             scratch_pool);
+  err = svn_fs_commit_txn(&inner_conflict_path,
+                          revision,
+                          eb->txn,
+                          scratch_pool);
   if (SVN_IS_VALID_REVNUM(*revision))
     {
       if (err)



Mime
View raw message