From a219d774fe558e62a790f55f43fc7f47e1c0b13e Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Wed, 12 May 2004 09:02:54 +0000
Subject: [PATCH] even if Curl_do() fails, we must call Curl_done() to do
 proper cleaning up

---
 lib/transfer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/transfer.c b/lib/transfer.c
index 039abf889f..67f328971c 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -2029,6 +2029,9 @@ CURLcode Curl_perform(struct SessionHandle *data)
         if(CURLE_OK == res)
           res = res2;
       }
+      else
+        /* Curl_do() failed, clean up left-overs in the done-call */
+        res2 = Curl_done(conn);
 
       /*
        * Important: 'conn' cannot be used here, since it may have been closed
-- 
GitLab