diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-20 11:58:41 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-06-18 15:56:59 +0200 |
commit | b5a6e598c9f596f13d6aec151ee2efb9bf696b21 (patch) | |
tree | 5b0dd0738651165dcb942ff421c1f813f1fc5130 /ftpfs/dir.c | |
parent | fda66d0405f0fdf42cc6c7ae5e494c4ca3c83ad7 (diff) |
ftpfs: fix error handling in refresh_dir
Found using the Clang Static Analyzer.
* ftpfs/dir.c (refresh_dir): Fix error handling.
Diffstat (limited to 'ftpfs/dir.c')
-rw-r--r-- | ftpfs/dir.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ftpfs/dir.c b/ftpfs/dir.c index da5ddbe5..a9fea22f 100644 --- a/ftpfs/dir.c +++ b/ftpfs/dir.c @@ -384,14 +384,18 @@ refresh_dir (struct ftpfs_dir *dir, int update_stats, time_t timestamp, if (! err) err = update_ordered_name ("..", &dfs); - /* Refetch the directory from the server. */ - if (update_stats) - /* Fetch both names and stat info. */ - err = ftp_conn_get_stats (conn, dir->rmt_path, 1, - update_ordered_entry, &dfs); - else - /* Just fetch names. */ - err = ftp_conn_get_names (conn, dir->rmt_path, update_ordered_name, &dfs); + if (! err) + { + /* Refetch the directory from the server. */ + if (update_stats) + /* Fetch both names and stat info. */ + err = ftp_conn_get_stats (conn, dir->rmt_path, 1, + update_ordered_entry, &dfs); + else + /* Just fetch names. */ + err = ftp_conn_get_names (conn, dir->rmt_path, + update_ordered_name, &dfs); + } if (! err) /* GC any directory entries that weren't seen this time. */ |