]> git.ipfire.org Git - thirdparty/git.git/commit - connect.c
connect.c: fix leak in handle_ssh_variant
authorJeff King <peff@peff.net>
Thu, 20 Apr 2017 20:21:58 +0000 (16:21 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Apr 2017 05:02:14 +0000 (22:02 -0700)
commit5d2993b6eabb0e0efdbe17bd43a3bec07a1670be
tree989c324d8025c74f4e8a510c09eb41c44162ad35
parent22e5ae5c8e6859e5670a2c6bbf5798778373144c
connect.c: fix leak in handle_ssh_variant

When we see an error from split_cmdline(), we exit the
function without freeing the copy of the command string we
made.

This was sort-of introduced by 22e5ae5c8 (connect.c: handle
errors from split_cmdline, 2017-04-10). The leak existed
before that, but before that commit fixed the bug, we could
never trigger this else clause in the first place.

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