Skip to content
Permalink
Browse files Browse the repository at this point in the history
Avoid a crash (double-free) when SSH connection fails
  • Loading branch information
bonsaiviking committed Nov 29, 2018
1 parent f893372 commit 350bbe0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nse_libssh2.cc
Expand Up @@ -12,7 +12,6 @@ extern "C" {
}
#include "nse_lua.h"

#include "nse_debug.h"
#include "nse_nsock.h"
#include "nse_utility.h"

Expand Down Expand Up @@ -295,6 +294,7 @@ static int do_session_handshake (lua_State *L, int status, lua_KContext ctx) {

if (rc) {
libssh2_session_free(sshu->session);
sshu->session = NULL;
return luaL_error(L, "Unable to complete libssh2 handshake.");
}

Expand Down Expand Up @@ -478,7 +478,7 @@ static int userauth_list (lua_State *L, int status, lua_KContext ctx) {
}

/*
* Returns list of supported authenication methods
* Returns list of supported authentication methods
*/
static int l_userauth_list (lua_State *L) {
return userauth_list(L, 0, 0);
Expand Down

0 comments on commit 350bbe0

Please sign in to comment.