diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,2 @@
+- 0.8.2.0
+    * Fix possible leaking of client sockets when connection times out
diff --git a/src/Network/WebSockets/Client.hs b/src/Network/WebSockets/Client.hs
--- a/src/Network/WebSockets/Client.hs
+++ b/src/Network/WebSockets/Client.hs
@@ -57,13 +57,13 @@
     -- Create and connect socket
     let hints = S.defaultHints
                     {S.addrFamily = S.AF_INET, S.addrSocketType = S.Stream}
-    sock      <- S.socket S.AF_INET S.Stream S.defaultProtocol
     addrInfos <- S.getAddrInfo (Just hints) (Just host) (Just $ show port)
-    S.connect sock (S.addrAddress $ head addrInfos)
+    sock      <- S.socket S.AF_INET S.Stream S.defaultProtocol
 
     -- Connect WebSocket and run client
     res <- finally
-        (runClientWithSocket sock host path opts customHeaders app)
+        (S.connect sock (S.addrAddress $ head addrInfos) >>
+         runClientWithSocket sock host path opts customHeaders app)
         (S.sClose sock)
 
     -- Clean up
diff --git a/websockets.cabal b/websockets.cabal
--- a/websockets.cabal
+++ b/websockets.cabal
@@ -1,5 +1,5 @@
 Name:    websockets
-Version: 0.8.1.3
+Version: 0.8.2.0
 
 Synopsis:
   A sensible and clean way to write WebSocket-capable servers in Haskell.
@@ -39,6 +39,9 @@
 
 Homepage:    http://jaspervdj.be/websockets
 Bug-reports: https://github.com/jaspervdj/websockets/issues
+
+Extra-source-files:
+  CHANGELOG
 
 Library
   Hs-source-dirs: src
