Skip to content

Commit

Permalink
global.c : fixed call to libssh2_crypto_exit libssh2#394 (libssh2#396)
Browse files Browse the repository at this point in the history
* global.c : fixed call to libssh2_crypto_exit libssh2#394

File: global.c 

Notes: Don't call `libssh2_crypto_exit()` until `_libssh2_initialized` count is down to zero.

Credit: seba30
  • Loading branch information
willco007 authored Jul 31, 2019
1 parent 92f7686 commit 0ceb477
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ libssh2_exit(void)

_libssh2_initialized--;

if(!(_libssh2_init_flags & LIBSSH2_INIT_NO_CRYPTO)) {
if(_libssh2_initialized == 0 &&
!(_libssh2_init_flags & LIBSSH2_INIT_NO_CRYPTO)) {
libssh2_crypto_exit();
}

Expand Down

0 comments on commit 0ceb477

Please sign in to comment.