diff --git a/library/bignum.c b/library/bignum.c index c26842f34..2420866c9 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -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 )