aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuinn Slack <sqs@cs.stanford.edu>2011-01-10 13:53:01 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-01-10 13:53:57 +0100
commit1238edaeaf947b896aafd9ddffc8430dea179c3a (patch)
tree837a4c68d75cf9447a67c29cf6b8f49d6691c9cb
parenta9cd4f4ed49e1a0b79f8fc6a0cb129331fa04f23 (diff)
SSL: fix memory leak
In OOM situation. Follow-up fix to commit a9cd4f4ed49e1a0.
-rw-r--r--lib/sslgen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sslgen.c b/lib/sslgen.c
index 9ee3ab1d8..c1a8a3073 100644
--- a/lib/sslgen.c
+++ b/lib/sslgen.c
@@ -350,8 +350,11 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
store->name = clone_host; /* clone host name */
store->remote_port = conn->remote_port; /* port number */
- if(!Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config))
+ if(!Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config)) {
+ store->sessionid = NULL; /* let caller free sessionid */
+ free(clone_host);
return CURLE_OUT_OF_MEMORY;
+ }
return CURLE_OK;
}