init output argument of got_path_skip_common_ancestor()
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)