Commit Diff


commit - 1b2f32fbcbbab1e5f19815a91667ebc56dd2463f
commit + 2aef7b234d92623c36d4b113d21ed5ecc010a926
blob - ef69835ff586c123713543589b878149636f7e51
blob + f67367d1512081ce314c3fdd7062701103036d17
--- lib/read_gotconfig_privsep.c
+++ lib/read_gotconfig_privsep.c
@@ -46,7 +46,7 @@ got_gotconfig_read(struct got_gotconfig **conf, const 
 	int fd = -1;
 	int imsg_fds[2] = { -1, -1 };
 	pid_t pid;
-	struct imsgbuf *ibuf;
+	struct imsgbuf *ibuf = NULL;
 
 	*conf = calloc(1, sizeof(**conf));
 	if (*conf == NULL)
@@ -56,7 +56,8 @@ got_gotconfig_read(struct got_gotconfig **conf, const 
 	if (fd == -1) {
 		if (errno == ENOENT)
 			return NULL;
-		return got_error_from_errno2("open", gotconfig_path);
+		err = got_error_from_errno2("open", gotconfig_path);
+		goto done;
 	}
 
 	ibuf = calloc(1, sizeof(*ibuf));