Commit Diff


commit - d0980f09b20ac878dcbc62fb940adf273a363f00
commit + f25a765e436b4da9fa7ea68c73e6f65a8f0d968e
blob - f0f625ddad473f4c65fabd04e165b109d87dacb7
blob + 79db43c49ad84782e167cf267f4958c7fa944561
--- 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) {