Skip to content

Commit f07be76

Browse files
committed
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 <[email protected]>
1 parent a520816 commit f07be76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

connect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,10 @@ static int handle_ssh_variant(const char *ssh_command, int is_cmdline,
716716
* any longer.
717717
*/
718718
free(ssh_argv);
719-
} else
719+
} else {
720+
free(ssh_argv);
720721
return 0;
722+
}
721723
}
722724

723725
if (!strcasecmp(variant, "plink") ||

0 commit comments

Comments
 (0)