From 55ef708e737deb6553fd241f7f0283d489d553a1 Mon Sep 17 00:00:00 2001 From: Bruce Doan Date: Fri, 31 Jul 2015 01:24:35 +0700 Subject: [PATCH] Free SSL handler to avoid memory leaks --- lib/pure/asyncnet.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim index cfd3d76664..9139200f33 100644 --- a/lib/pure/asyncnet.nim +++ b/lib/pure/asyncnet.nim @@ -453,6 +453,7 @@ proc close*(socket: AsyncSocket) = when defined(ssl): if socket.isSSL: let res = SslShutdown(socket.sslHandle) + SSLFree(socket.sslHandle) if res == 0: discard elif res != 1: @@ -567,4 +568,3 @@ when not defined(testing) and isMainModule: var f = accept(sock) f.callback = onAccept runForever() -