mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-04 08:55:09 +00:00
Fix possible fd leak in test file
This commit is contained in:
parent
401caadebd
commit
e43187d59d
@ -97,6 +97,7 @@ void mpi_read_file( int radix_X, char *input_file, char *input_A,
|
||||
unsigned char buf[1000];
|
||||
size_t buflen;
|
||||
FILE *file;
|
||||
int ret;
|
||||
|
||||
memset( buf, 0x00, 1000 );
|
||||
memset( str, 0x00, 1000 );
|
||||
@ -105,8 +106,9 @@ void mpi_read_file( int radix_X, char *input_file, char *input_A,
|
||||
|
||||
file = fopen( input_file, "r" );
|
||||
TEST_ASSERT( file != NULL );
|
||||
TEST_ASSERT( mpi_read_file( &X, radix_X, file ) == result );
|
||||
ret = mpi_read_file( &X, radix_X, file );
|
||||
fclose(file);
|
||||
TEST_ASSERT( ret == result );
|
||||
|
||||
if( result == 0 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user