Commit 2fb669fbbb380829c73db7047672204daa96de3c

Stefan Sperling 2020-03-20T20:23:18

initialize optional output parameters in parse_gitconfig_file()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/repository.c b/lib/repository.c
index 1c7c3d1..bd2ded9 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -375,6 +375,12 @@ parse_gitconfig_file(int *gitconfig_repository_format_version,
 	*gitconfig_repository_format_version = 0;
 	*gitconfig_author_name = NULL;
 	*gitconfig_author_email = NULL;
+	if (remotes)
+		*remotes = NULL;
+	if (nremotes)
+		*nremotes = 0;
+	if (gitconfig_owner)
+		*gitconfig_owner = NULL;
 
 	fd = open(gitconfig_path, O_RDONLY);
 	if (fd == -1) {