Fix valgrind error - memory leak in yassl's SSL_remove_state

This commit is contained in:
Vladislav Vaintroub 2016-03-22 19:02:05 +01:00
parent 6950f83d5e
commit e6921f28c1
3 changed files with 8 additions and 1 deletions

View file

@ -342,6 +342,7 @@ private:
Sessions& GetSessions(); // forward singletons
sslFactory& GetSSL_Factory();
Errors& GetErrors();
bool HasErrors();
// openSSL method and context types

View file

@ -1493,7 +1493,8 @@ int SSLeay_add_ssl_algorithms() // compatibility only
void ERR_remove_state(unsigned long)
{
GetErrors().Remove();
if (HasErrors())
GetErrors().Remove();
}

View file

@ -1688,6 +1688,11 @@ Errors& GetErrors()
return *errorsInstance;
}
bool HasErrors()
{
return (errorsInstance != 0);
}
typedef Mutex::Lock Lock;