Correct memory leak in RSA test suite
The test for `mbedtls_rsa_import_raw` didn't include freeing the allocate buffers.
diff --git a/tests/suites/test_suite_rsa.function b/tests/suites/test_suite_rsa.function
index f321554..b965bd6 100644
--- a/tests/suites/test_suite_rsa.function
+++ b/tests/suites/test_suite_rsa.function
@@ -1329,20 +1329,19 @@
size_t lenE = 0;
mbedtls_rsa_context ctx;
-
mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg;
+
const char *pers = "test_suite_rsa";
mbedtls_ctr_drbg_init( &ctr_drbg );
-
mbedtls_entropy_init( &entropy );
+ mbedtls_rsa_init( &ctx, 0, 0 );
+
TEST_ASSERT( mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func,
&entropy, (const unsigned char *) pers,
strlen( pers ) ) == 0 );
- mbedtls_rsa_init( &ctx, 0, 0 );
-
if( strlen( input_N ) )
lenN = unhexify( bufN, input_N );
@@ -1437,6 +1436,10 @@
exit:
+ mbedtls_free( buf_orig );
+ mbedtls_free( buf_enc );
+ mbedtls_free( buf_dec );
+
mbedtls_rsa_free( &ctx );
mbedtls_ctr_drbg_free( &ctr_drbg );