From cdea97c1c310e6adfbcf92e5feb90f2841efde78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 20 Oct 2015 20:04:15 +0200 Subject: [PATCH] Remove useless code closes #321 --- library/ssl_tls.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 9142be856..da9f8bf45 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5735,11 +5735,7 @@ int mbedtls_ssl_set_hs_psk( mbedtls_ssl_context *ssl, mbedtls_free( ssl->handshake->psk ); if( ( ssl->handshake->psk = mbedtls_calloc( 1, psk_len ) ) == NULL ) - { - mbedtls_free( ssl->handshake->psk ); - ssl->handshake->psk = NULL; return( MBEDTLS_ERR_SSL_ALLOC_FAILED ); - } ssl->handshake->psk_len = psk_len; memcpy( ssl->handshake->psk, psk, ssl->handshake->psk_len );