initialize *outfile in got_opentemp_named()
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();