handle_ssh_variant: plug memory leak

The split_cmdline() function either assigns an allocated array to the argv
parameter or NULL. In the first case, we have to free() it, in the latter
it does no harm.

Reported via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2017-04-21 14:53:58 +02:00
parent a5208164e2
commit f07be76f51

View File

@@ -716,8 +716,10 @@ static int handle_ssh_variant(const char *ssh_command, int is_cmdline,
* any longer.
*/
free(ssh_argv);
} else
} else {
free(ssh_argv);
return 0;
}
}
if (!strcasecmp(variant, "plink") ||