You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/03/28 00:16:36 UTC

svn commit: r928302 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Author: gstein
Date: Sat Mar 27 23:16:36 2010
New Revision: 928302

URL: http://svn.apache.org/viewvc?rev=928302&view=rev
Log:
Fix a potential error leak, and a potential uninitialized value.

* subversion/libsvn_wc/update_editor.c:
  (add_directory): only examine the switched case (for obstruction) if the
    wc_root case did not generate an error. move the err test inside the
    block, where we had assigned NULL to err before the checks. 

Modified:
    subversion/trunk/subversion/libsvn_wc/update_editor.c

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=928302&r1=928301&r2=928302&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sat Mar 27 23:16:36 2010
@@ -2411,7 +2411,6 @@ add_directory(const char *path,
                              NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                              NULL,
                              eb->db, db->local_abspath, db->pool, db->pool);
-
   if (err)
     {
       if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
@@ -2482,7 +2481,7 @@ add_directory(const char *path,
                          svn_dirent_local_style(db->local_abspath, pool));
             }
 
-          if (switched && !eb->switch_relpath)
+          if (!err && switched && !eb->switch_relpath)
             {
               err = svn_error_createf(
                          SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
@@ -2492,15 +2491,15 @@ add_directory(const char *path,
                          svn_path_url_add_component2(eb->repos_root,
                                                      db->new_relpath, pool));
             }
-        }
 
-      if (err != NULL)
-        {
-          db->already_notified = TRUE;
-          do_notification(eb, db->local_abspath, svn_node_dir,
-                          svn_wc_notify_update_obstruction, pool);
+          if (err != NULL)
+            {
+              db->already_notified = TRUE;
+              do_notification(eb, db->local_abspath, svn_node_dir,
+                              svn_wc_notify_update_obstruction, pool);
 
-          return svn_error_return(err);
+              return svn_error_return(err);
+            }
         }
 
       /* What to do with a versioned or schedule-add dir: