aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-09-06 06:26:24 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-09-06 06:26:24 +0000
commit86da31e0317773cb3a6cee21a6a97ea999aba3b3 (patch)
tree3b75b6730844516ed1aacdfefb6d2f69bd8967e9
parent1d7075e339a71e64e94d3a106a736f1d9a8c813b (diff)
Curl_SSL_Close_All() now checks that we have a session cache before we run
around killing entries in it!
-rw-r--r--lib/ssluse.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index 50bc621fa..2125ba914 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -412,13 +412,15 @@ static int Kill_Single_Session(struct curl_ssl_session *session)
int Curl_SSL_Close_All(struct SessionHandle *data)
{
int i;
- for(i=0; i< data->set.ssl.numsessions; i++)
- /* the single-killer function handles empty table slots */
- Kill_Single_Session(&data->set.ssl.session[i]);
-
- /* free the cache data */
- free(data->set.ssl.session);
+ if(data->set.ssl.session) {
+ for(i=0; i< data->set.ssl.numsessions; i++)
+ /* the single-killer function handles empty table slots */
+ Kill_Single_Session(&data->set.ssl.session[i]);
+
+ /* free the cache data */
+ free(data->set.ssl.session);
+ }
return 0;
}