summaryrefslogtreecommitdiff
path: root/lib/share.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-01-18 23:39:30 +0100
committerYang Tse <yangsita@gmail.com>2012-01-18 23:42:39 +0100
commitd56b4c3f89ad3ee28dc62a22cffe2c85ced19830 (patch)
tree95962f4316d8b91eb4dafeafd75a093297bb9561 /lib/share.c
parentd1becc3231ae570be19858491c5c9f2fe48c1fd7 (diff)
downloadcurl-d56b4c3f89ad3ee28dc62a22cffe2c85ced19830.tar.gz
ssl session caching: fix compiler warnings
Diffstat (limited to 'lib/share.c')
-rw-r--r--lib/share.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/share.c b/lib/share.c
index a89e15e3d..839b33e60 100644
--- a/lib/share.c
+++ b/lib/share.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -88,8 +88,8 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
case CURL_LOCK_DATA_SSL_SESSION:
#ifdef USE_SSL
if(!share->sslsession) {
- share->nsslsession = 8;
- share->sslsession = calloc(share->nsslsession,
+ share->max_ssl_sessions = 8;
+ share->sslsession = calloc(share->max_ssl_sessions,
sizeof(struct curl_ssl_session));
share->sessionage = 0;
if(!share->sslsession)
@@ -132,11 +132,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
case CURL_LOCK_DATA_SSL_SESSION:
#ifdef USE_SSL
- if(share->sslsession) {
- free(share->sslsession);
- share->sslsession = NULL;
- share->nsslsession = 0;
- }
+ Curl_safefree(share->sslsession);
break;
#else
return CURLSHE_NOT_BUILT_IN;
@@ -202,8 +198,8 @@ curl_share_cleanup(CURLSH *sh)
#ifdef USE_SSL
if(share->sslsession) {
- unsigned int i;
- for(i = 0; i < share->nsslsession; ++i)
+ size_t i;
+ for(i = 0; i < share->max_ssl_sessions; i++)
Curl_ssl_kill_session(&(share->sslsession[i]));
free(share->sslsession);
}