mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-09 02:55:27 +00:00
Fix potential memory leak in bignum selftest
This commit is contained in:
parent
7fd620b331
commit
d220f8b709
|
@ -2028,7 +2028,8 @@ int mpi_self_test( int verbose )
|
|||
if( verbose != 0 )
|
||||
printf( "failed\n" );
|
||||
|
||||
return( 1 );
|
||||
ret = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
|
@ -2053,7 +2054,8 @@ int mpi_self_test( int verbose )
|
|||
if( verbose != 0 )
|
||||
printf( "failed\n" );
|
||||
|
||||
return( 1 );
|
||||
ret = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
|
@ -2074,7 +2076,8 @@ int mpi_self_test( int verbose )
|
|||
if( verbose != 0 )
|
||||
printf( "failed\n" );
|
||||
|
||||
return( 1 );
|
||||
ret = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
|
@ -2096,7 +2099,8 @@ int mpi_self_test( int verbose )
|
|||
if( verbose != 0 )
|
||||
printf( "failed\n" );
|
||||
|
||||
return( 1 );
|
||||
ret = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
|
@ -2111,15 +2115,16 @@ int mpi_self_test( int verbose )
|
|||
MPI_CHK( mpi_lset( &X, gcd_pairs[i][0] ) );
|
||||
MPI_CHK( mpi_lset( &Y, gcd_pairs[i][1] ) );
|
||||
|
||||
MPI_CHK( mpi_gcd( &A, &X, &Y ) );
|
||||
MPI_CHK( mpi_gcd( &A, &X, &Y ) );
|
||||
|
||||
if( mpi_cmp_int( &A, gcd_pairs[i][2] ) != 0 )
|
||||
{
|
||||
if( verbose != 0 )
|
||||
printf( "failed at %d\n", i );
|
||||
if( mpi_cmp_int( &A, gcd_pairs[i][2] ) != 0 )
|
||||
{
|
||||
if( verbose != 0 )
|
||||
printf( "failed at %d\n", i );
|
||||
|
||||
return( 1 );
|
||||
}
|
||||
ret = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
|
|
Loading…
Reference in a new issue