Add SSLFree after SLShutdown to prevent memory leak

This commit is contained in:
wiffel 2015-02-24 22:01:07 +01:00
commit 72e4e7291f
2 changed files with 4 additions and 0 deletions

View file

@ -454,6 +454,8 @@ proc close*(socket: Socket) =
# shutdown i.e not wait for the peers "close notify" alert with a second
# call to SSLShutdown
let res = SSLShutdown(socket.sslHandle)
SSLFree(socket.sslHandle)
socket.sslHandle = nil
if res == 0:
discard
elif res != 1: