From 8eb8a0a8e4ee854f063d589fc97bfbf89836a5dd Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 12 Mar 2001 09:44:57 +0000
Subject: [PATCH] bugfix: don't use the connectindex if it is -1

---
 lib/url.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/url.c b/lib/url.c
index 44e2328fb5..c6e19df02e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1814,7 +1814,8 @@ CURLcode Curl_connect(struct UrlData *data,
       int index;
       index = conn->connectindex; /* get the index */
       Curl_disconnect(conn);      /* close the connection */
-      data->connects[index]=NULL; /* clear the pointer */
+      if(-1 != index)
+        data->connects[index]=NULL; /* clear the pointer */
     }
   }
   return code;
-- 
GitLab