Session serialiser's buffer should not be talloced (alloced and freed in the same...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 20 Jun 2014 08:17:15 +0000 (09:17 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 20 Jun 2014 08:17:53 +0000 (09:17 +0100)
src/main/tls.c

index 640bed4..6b626d3 100644 (file)
@@ -1015,8 +1015,10 @@ static int cbtls_new_session(SSL *ssl, SSL_SESSION *sess)
                        return 0;
                }
 
+
+               /* Do not convert to TALLOC - Thread safety */
                /* alloc and convert to ASN.1 */
-               sess_blob = talloc_array(conf, unsigned char, blob_len);
+               sess_blob = malloc(blob_len);
                if (!sess_blob) {
                        DEBUG2("  SSL: could not allocate buffer len=%d to persist session", blob_len);
                        return 0;
@@ -1055,7 +1057,7 @@ static int cbtls_new_session(SSL *ssl, SSL_SESSION *sess)
        }
 
 error:
-       if (sess_blob) talloc_free(sess_blob);
+       free(sess_blob);
 
        return 0;
 }