aboutsummaryrefslogtreecommitdiff
path: root/lib/ssluse.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-13 15:19:02 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-13 15:19:02 +0000
commitb5f85ba77d11b3e1de2fb5f2989badeff983f5e7 (patch)
tree2d88f49e4c809449afa1e52c6b2d759d52a1fc84 /lib/ssluse.c
parentb6ee33c6e11decca2842a356c6d68f2bd28d00a0 (diff)
memory cleanup and check fix
Diffstat (limited to 'lib/ssluse.c')
-rw-r--r--lib/ssluse.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index c2a16d136..8a18597fe 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -573,7 +573,7 @@ static int Kill_Single_Session(struct curl_ssl_session *session)
Curl_free_ssl_config(&session->ssl_config);
- free(session->name);
+ Curl_safefree(session->name);
session->name = NULL; /* no name */
return 0; /* ok */
@@ -619,6 +619,11 @@ static int Store_SSL_Session(struct connectdata *conn,
struct SessionHandle *data=conn->data; /* the mother of all structs */
struct curl_ssl_session *store = &data->state.session[0];
int oldest_age=data->state.session[0].age; /* zero if unused */
+ char *clone_host;
+
+ clone_host = strdup(conn->host.name);
+ if(!clone_host)
+ return -1; /* bail out */
/* ask OpenSSL, say please */
@@ -662,7 +667,7 @@ static int Store_SSL_Session(struct connectdata *conn,
/* now init the session struct wisely */
store->sessionid = ssl_sessionid;
store->age = data->state.sessionage; /* set current age */
- store->name = strdup(conn->host.name); /* clone host name */
+ store->name = clone_host; /* clone host name */
store->remote_port = conn->remote_port; /* port number */
Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config);