commit | 43b08574a6d6e138e2bf707a69d1f499b126e19f | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Wed May 27 17:23:30 2015 +0200 |
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Wed May 27 17:23:30 2015 +0200 |
tree | 02a204ac38ea743d8811d7ea81d85f8ac652999a | |
parent | 3a89559d715f5b805384073af421430219eeafce [diff] [blame] |
Avoid memory leak with repeated [gc]ccm_setkey()
diff --git a/library/ccm.c b/library/ccm.c index 75de8cb..aa2d675 100644 --- a/library/ccm.c +++ b/library/ccm.c
@@ -81,6 +81,8 @@ if( cipher_info->block_size != 16 ) return( MBEDTLS_ERR_CCM_BAD_INPUT ); + mbedtls_cipher_free( &ctx->cipher_ctx ); + if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 ) return( ret );