fix invalid imsg_free() in got_privsep_recv_printed_commits()
commit54e38878133e773338308e227bc839a2515f14ba
authorOmar Polo <op@omarpolo.com>
Mon, 26 Feb 2024 16:09:07 +0000 (26 16:09 +0000)
committerThomas Adam <thomas@xteddy.org>
Sat, 2 Mar 2024 00:19:56 +0000 (2 00:19 +0000)
tree1f5a31f4da572d5404b2d2650f82ca41027f94b0
parenteb0f0005dd7c9fa9b95084632cc50d5d61ed81a0
fix invalid imsg_free() in got_privsep_recv_printed_commits()

Depending on the error got_privsep_recv_imsg() may leave imsg
un-initialized, so change it to always free the imsg on error if
needed, so callers don't have to.

got_privsep_recv_printed_commits() and got-read-patch were the only
places where we could end up calling imsg_free() on uninitialized
imsg, fix them.

ok stsp@
lib/privsep.c
libexec/got-read-patch/got-read-patch.c