Commit Diff


commit - 1d84e08292747f0be91c166aaf820a3f0e87325d
commit + ceda7883426ddd62fbad61fd7b4855f18b7244ad
blob - 101bba534b1ae3ad47fbd0e0a4f80c189fb8e4ec
blob + 0e97b2c937873b7c5db92e61abfb7035c1636fec
--- lib/privsep.c
+++ lib/privsep.c
@@ -2274,8 +2274,8 @@ got_privsep_recv_gitconfig_remotes(struct got_remote_r
 	switch (imsg.hdr.type) {
 	case GOT_IMSG_GITCONFIG_REMOTES:
 		if (datalen != sizeof(iremotes)) {
-			err = got_error(GOT_ERR_PRIVSEP_LEN);
-			break;
+			imsg_free(&imsg);
+			return got_error(GOT_ERR_PRIVSEP_LEN);
 		}
 		memcpy(&iremotes, imsg.data, sizeof(iremotes));
 		if (iremotes.nremotes == 0) {