mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 15:58:12 +00:00
Fix possible fd leak in test file
This commit is contained in:
parent
401caadebd
commit
e43187d59d
1 changed files with 3 additions and 1 deletions
|
@ -97,6 +97,7 @@ void mpi_read_file( int radix_X, char *input_file, char *input_A,
|
||||||
unsigned char buf[1000];
|
unsigned char buf[1000];
|
||||||
size_t buflen;
|
size_t buflen;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
int ret;
|
||||||
|
|
||||||
memset( buf, 0x00, 1000 );
|
memset( buf, 0x00, 1000 );
|
||||||
memset( str, 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" );
|
file = fopen( input_file, "r" );
|
||||||
TEST_ASSERT( file != NULL );
|
TEST_ASSERT( file != NULL );
|
||||||
TEST_ASSERT( mpi_read_file( &X, radix_X, file ) == result );
|
ret = mpi_read_file( &X, radix_X, file );
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
TEST_ASSERT( ret == result );
|
||||||
|
|
||||||
if( result == 0 )
|
if( result == 0 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue