Commit e6921f28 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix valgrind error - memory leak in yassl's SSL_remove_state

parent 6950f83d
...@@ -342,6 +342,7 @@ private: ...@@ -342,6 +342,7 @@ private:
Sessions& GetSessions(); // forward singletons Sessions& GetSessions(); // forward singletons
sslFactory& GetSSL_Factory(); sslFactory& GetSSL_Factory();
Errors& GetErrors(); Errors& GetErrors();
bool HasErrors();
// openSSL method and context types // openSSL method and context types
......
...@@ -1493,6 +1493,7 @@ int SSLeay_add_ssl_algorithms() // compatibility only ...@@ -1493,6 +1493,7 @@ int SSLeay_add_ssl_algorithms() // compatibility only
void ERR_remove_state(unsigned long) void ERR_remove_state(unsigned long)
{ {
if (HasErrors())
GetErrors().Remove(); GetErrors().Remove();
} }
......
...@@ -1688,6 +1688,11 @@ Errors& GetErrors() ...@@ -1688,6 +1688,11 @@ Errors& GetErrors()
return *errorsInstance; return *errorsInstance;
} }
bool HasErrors()
{
return (errorsInstance != 0);
}
typedef Mutex::Lock Lock; typedef Mutex::Lock Lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment