From 624745ab20a7826e18f300cc19ef496f0224dad0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 9 Nov 2006 21:54:33 +0000 Subject: Dmitriy Sergeyev found a SIGSEGV with his test04.c example posted on 7 Nov 2006. It turned out we wrongly assumed that the connection cache was present when tearing down a connection. --- lib/url.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index c5ce746c0..cc3c87eb9 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1804,7 +1804,10 @@ CURLcode Curl_disconnect(struct connectdata *conn) if(-1 != conn->connectindex) { /* unlink ourselves! */ infof(data, "Closing connection #%ld\n", conn->connectindex); - data->state.connc->connects[conn->connectindex] = NULL; + if(data->state.connc) + /* only clear the table entry if we still know in which cache we + used to be in */ + data->state.connc->connects[conn->connectindex] = NULL; } #ifdef USE_LIBIDN -- cgit v1.2.3