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>
maint
parent
22e5ae5c8e
commit
5d2993b6ea
|
@ -738,9 +738,11 @@ static void handle_ssh_variant(const char *ssh_command, int is_cmdline,
|
||||||
* any longer.
|
* any longer.
|
||||||
*/
|
*/
|
||||||
free(ssh_argv);
|
free(ssh_argv);
|
||||||
} else
|
} else {
|
||||||
|
free(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcasecmp(variant, "plink") ||
|
if (!strcasecmp(variant, "plink") ||
|
||||||
!strcasecmp(variant, "plink.exe"))
|
!strcasecmp(variant, "plink.exe"))
|
||||||
|
|
Loading…
Reference in New Issue