commit | 24417f06feda5a0756c362146c932909c19b6673 | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg2@elzevir.fr> | Mon Sep 28 18:09:45 2015 +0200 |
committer | Manuel Pégourié-Gonnard <mpg2@elzevir.fr> | Mon Sep 28 18:09:45 2015 +0200 |
tree | 0c9f80ccd5f2eba59a50287fcd98a7c9828f344f | |
parent | f592e8eaf6f970489c57e02ac35c3f6721c51413 [diff] [blame] |
Fix potential double-free in mbedtls_ssl_conf_psk()
diff --git a/library/ssl_tls.c b/library/ssl_tls.c index d9b05fd..c1e29c7 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c
@@ -5707,7 +5707,9 @@ ( conf->psk_identity = mbedtls_calloc( 1, psk_identity_len ) ) == NULL ) { mbedtls_free( conf->psk ); + mbedtls_free( conf->psk_identity ); conf->psk = NULL; + conf->psk_identity = NULL; return( MBEDTLS_ERR_SSL_ALLOC_FAILED ); }