Commit 0c92744a7b39f92be3b99012f3d7d0ebf0c428fb

Stefan Sperling 2018-09-20T15:05:17

initialize *outfile in got_opentemp_named()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/opentemp.c b/lib/opentemp.c
index 90af269..082513f 100644
--- a/lib/opentemp.c
+++ b/lib/opentemp.c
@@ -62,6 +62,8 @@ got_opentemp_named(char **path, FILE **outfile, const char *basepath)
 	const struct got_error *err = NULL;
 	int fd;
 
+	*outfile = NULL;
+
 	if (asprintf(path, "%s-XXXXXX", basepath) == -1) {
 		*path = NULL;
 		return got_error_from_errno();