Commit e6b1056ef3e2060a93683e3069bbc1bb48c40e87

Stefan Sperling 2018-04-22T13:21:17

initialize output parameter in object_path()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object.c b/lib/object.c
index 47ed4b5..76455bb 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -215,6 +215,8 @@ object_path(char **path, struct got_object_id *id, struct got_repository *repo)
 	char *hex;
 	char *path_objects = got_repo_get_path_objects(repo);
 
+	*path = NULL;
+
 	if (path_objects == NULL)
 		return got_error_from_errno();