Commit Diff


commit - 8138f3e172dbeb6d845fda505dde9b15b85ec310
commit + ef5e02fd4b2b09f48d9f96a78d13f6655c85ce81
blob - c4026c7123c5faeffcbed3df40732d272df018a0
blob + 4a26baa63e35c0e5ca8c307412f473a1d1f141ab
--- lib/fileindex.c
+++ lib/fileindex.c
@@ -922,9 +922,10 @@ walk_dir(struct got_pathlist_entry **next, struct got_
 
 		subdir = opendir(subdirpath);
 		if (subdir == NULL) {
+			err = got_error_from_errno2("opendir", subdirpath);
 			free(subpath);
 			free(subdirpath);
-			return got_error_from_errno2("opendir", subdirpath);
+			return err;
 		}
 
 		err = read_dirlist(&subdirlist, subdir, subdirpath);