From 1e3161a20d5759409fec9aa339f79c5f71cabe65 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Oct 2016 13:11:55 +0200 Subject: polarssl: fix unaligned SSL session-id lock --- lib/vtls/polarssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/vtls/polarssl.c b/lib/vtls/polarssl.c index 2ef19a7ca..0be34971e 100644 --- a/lib/vtls/polarssl.c +++ b/lib/vtls/polarssl.c @@ -344,13 +344,14 @@ polarssl_connect_step1(struct connectdata *conn, Curl_ssl_sessionid_lock(conn); if(!Curl_ssl_getsessionid(conn, &old_session, NULL)) { ret = ssl_set_session(&connssl->ssl, old_session); - Curl_ssl_sessionid_unlock(conn); if(ret) { + Curl_ssl_sessionid_unlock(conn); failf(data, "ssl_set_session returned -0x%x", -ret); return CURLE_SSL_CONNECT_ERROR; } infof(data, "PolarSSL re-using session\n"); } + Curl_ssl_sessionid_unlock(conn); } ssl_set_ca_chain(&connssl->ssl, -- cgit v1.2.3