Commit Diff


commit - 9bd4f34ff9e07c077864143a61f5152ad1baa376
commit + b642df222fe314b84ca87cefd3f086907f35df5c
blob - ed35f4ea7ec319548a7a11e1a9658f9a156b48e6
blob + 14537c5cce57d708e10787a44cfd196c34bb6263
--- libexec/got-read-patch/got-read-patch.c
+++ libexec/got-read-patch/got-read-patch.c
@@ -664,6 +664,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
@@ -712,5 +713,6 @@ done:
 		err = got_error_from_errno("fclose");
 	if (close(GOT_IMSG_FD_CHILD) == -1 && err == NULL)
 		err = got_error_from_errno("close");
+	imsgbuf_clear(&ibuf);
 	return err ? 1 : 0;
 }