1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

tests: Check for NULL in torture_client_config

CID 1396566

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-11-05 07:52:43 +01:00
parent 86dabfe7e4
commit a8ed5e31dc

View File

@@ -65,8 +65,12 @@ static int teardown(void **state)
char *filename; char *filename;
filename = ssh_path_expand_tilde("~/.ssh/config"); filename = ssh_path_expand_tilde("~/.ssh/config");
if (filename != NULL) {
if (strlen(filename) > 0) {
unlink(filename); unlink(filename);
free(filename); }
SAFE_FREE(filename);
}
unlink(LIBSSH_SSH_CONFIG); unlink(LIBSSH_SSH_CONFIG);