Changed memory allocation of tls_key