diff --git a/src/bruteforce_ssh.c b/src/bruteforce_ssh.c index 2d10392..f78be90 100644 --- a/src/bruteforce_ssh.c +++ b/src/bruteforce_ssh.c @@ -65,11 +65,11 @@ int bruteforce_ssh_login(btkg_context_t *context, const char *hostname, int r; r = ssh_connect(my_ssh_session); if (r != SSH_OK) { - ssh_free(my_ssh_session); if (context->verbose & CBRUTEKRAG_VERBOSE_MODE) { log_error("[!] Error connecting to %s:%d %s.", hostname, port, ssh_get_error(my_ssh_session)); } + ssh_free(my_ssh_session); return -1; }