fix invalid imsg_free() in got_privsep_recv_printed_commits()
commitf9e9269513c7ee687c46d6060a784a9ca11646ce
authorOmar Polo <op@omarpolo.com>
Mon, 26 Feb 2024 16:09:07 +0000 (26 16:09 +0000)
committerOmar Polo <op@omarpolo.com>
Mon, 26 Feb 2024 16:09:07 +0000 (26 16:09 +0000)
tree54f5232f1cae93002643244b252564a565244bfe
parent7a86002db34d49472a7d75c1802ee99c2120ef3c
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