Commit Diff


commit - 9671dc9a57432bca74d0b261699b91df77e91a14
commit + 55e5ee714541266b7ee578082a5e0206c566f289
blob - 941d899ffe34503cf9f82ba20f3e587581c384df
blob + 97954a96cd153a960a09841086be9d9d3197c8d5
--- libexec/got-fetch-pack/got-fetch-pack.c
+++ libexec/got-fetch-pack/got-fetch-pack.c
@@ -889,6 +889,7 @@ main(int argc, char **argv)
 	if (pledge("stdio recvfd", NULL) == -1) {
 		err = got_error_from_errno("pledge");
 		got_privsep_send_error(&ibuf, err);
+		imsgbuf_clear(&ibuf);
 		return 1;
 	}
 #endif
@@ -1111,8 +1112,10 @@ done:
 	if (err != NULL) {
 		fprintf(stderr, "%s: %s\n", getprogname(), err->msg);
 		got_privsep_send_error(&ibuf, err);
+		imsgbuf_clear(&ibuf);
 		exit(1);
 	}
 
+	imsgbuf_clear(&ibuf);
 	exit(0);
 }