Commit db5ba8eda276cd122138244b297aa510587dedf9

Stefan Sperling 2019-03-26T08:59:56

init output argument of got_path_skip_common_ancestor()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/path.c b/lib/path.c
index 5da704b..5be3f98 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -122,6 +122,8 @@ got_path_skip_common_ancestor(char **child, const char *parent_abspath,
 	const struct got_error *err = NULL;
 	size_t len_parent, len, bufsize;
 
+	*child = NULL;
+
 	len_parent = strlen(parent_abspath);
 	len = strlen(abspath);
 	if (len_parent >= len)