gpg-interface: fix leak of "line" in parse_ssh_output()
commit78d468f1a9c7bf9d1724840ff322b9144061b308
authorJeff King <peff@peff.net>
Mon, 18 Oct 2021 17:15:00 +0000 (18 13:15 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Oct 2021 20:16:51 +0000 (18 13:16 -0700)
tree58c1f3939467ed6f601ce53d1cb042e29390a9ef
parent9fb391bff9258dd83b7c218fd9bb6ddb6e7b425e
gpg-interface: fix leak of "line" in parse_ssh_output()

We xmemdupz() this buffer, but never free it. Let's do so. We'll use a
cleanup label, since there are multiple exits from the function.

Note that it was also declared a "const char *". We could switch that to
"char *" to indicate that it's allocated, but that make it awkward to
use with skip_prefix(). So instead, we'll introduce an extra non-const
pointer.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gpg-interface.c