Commit Diff


commit - 2f6519cc051376f41ed4f45fcd6d63c0e7ff5642
commit + 417258479785447bb8b2d6106b1220cd833e4591
blob - 00dbdebf54e0335e148296057d897cb9f431e29f
blob + e1d0575506fa5d57b220ca223d441cc8ac55513f
--- lib/read_gotconfig_privsep.c
+++ lib/read_gotconfig_privsep.c
@@ -47,7 +47,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)
@@ -57,7 +57,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));