Commit 41d2888bab776a1275b697b9eb293b81045bfee7

Stefan Sperling 2019-08-11T20:03:36

move an assignment closer to error check in got_object_get_path()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/object.c b/lib/object.c
index 60a273e..d247b09 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -114,10 +114,11 @@ got_object_get_path(char **path, struct got_object_id *id,
 {
 	const struct got_error *err = NULL;
 	char *hex = NULL;
-	char *path_objects = got_repo_get_path_objects(repo);
+	char *path_objects;
 
 	*path = NULL;
 
+	path_objects = got_repo_get_path_objects(repo);
 	if (path_objects == NULL)
 		return got_error_from_errno("got_repo_get_path_objects");