aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-11-09 21:54:33 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-11-09 21:54:33 +0000
commit624745ab20a7826e18f300cc19ef496f0224dad0 (patch)
tree50c0d387ade37f25fa30c7ceb013c4faaa9f1150 /lib/url.c
parent9354822e09ce11fce78a45a897fe2a184565a35e (diff)
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.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c5
1 files changed, 4 insertions, 1 deletions
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