plug a memory leak in got_privsep_recv_tree() in error case found while looking over tracey's scan-build results
diff --git a/lib/privsep.c b/lib/privsep.c
index 79edb65..bc39682 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -1199,8 +1199,11 @@ get_more:
break;
}
- if (imsg.hdr.len < IMSG_HEADER_SIZE + min_datalen)
- return got_error(GOT_ERR_PRIVSEP_LEN);
+ if (imsg.hdr.len < IMSG_HEADER_SIZE + min_datalen) {
+ imsg_free(&imsg);
+ err = got_error(GOT_ERR_PRIVSEP_LEN);
+ break;
+ }
datalen = imsg.hdr.len - IMSG_HEADER_SIZE;