bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 07/12] ftpfs: fix error handling in refresh_dir


From: Justus Winter
Subject: [PATCH 07/12] ftpfs: fix error handling in refresh_dir
Date: Wed, 20 Nov 2013 14:38:00 +0100

Found using the Clang Static Analyzer.

* ftpfs/dir.c (refresh_dir): Fix error handling.
---
 ftpfs/dir.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ftpfs/dir.c b/ftpfs/dir.c
index da5ddbe..61c337b 100644
--- a/ftpfs/dir.c
+++ b/ftpfs/dir.c
@@ -381,8 +381,12 @@ refresh_dir (struct ftpfs_dir *dir, int update_stats, 
time_t timestamp,
   /* Make sure `.' and `..' are always included (if the actual list also
      includes `.' and `..', the ordered may be rearranged).  */
   err = update_ordered_name (".", &dfs);
-  if (! err)
-    err = update_ordered_name ("..", &dfs);
+  if (err)
+    goto out;
+
+  err = update_ordered_name ("..", &dfs);
+  if (err)
+    goto out;
 
   /* Refetch the directory from the server.  */
   if (update_stats)
@@ -407,6 +411,7 @@ refresh_dir (struct ftpfs_dir *dir, int update_stats, 
time_t timestamp,
       sweep (dir);
     }
 
+ out:
   ftpfs_release_ftp_conn (dir->fs, conn);
 
   return err;
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]