diff options
-rw-r--r-- | lib/gnutls.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gnutls.c b/lib/gnutls.c index 1e48b1e6cb..47ad4babad 100644 --- a/lib/gnutls.c +++ b/lib/gnutls.c @@ -149,6 +149,10 @@ int gnutls_init(GNUTLS_STATE * state, ConnectionEnd con_end) /* This function clears all buffers associated with the state. */ int gnutls_deinit(GNUTLS_STATE * state) { + /* if the session has failed abnormally it has to be removed from the db */ + if ( (*state)->gnutls_internals.resumable==RESUME_FALSE) { + _gnutls_db_remove_session( (*state), (*state)->security_parameters.session_id, (*state)->security_parameters.session_id_size); + } gnutls_free((*state)->connection_state.read_compression_state); gnutls_free((*state)->connection_state.read_mac_secret); gnutls_free((*state)->connection_state.write_compression_state); |