Fix potential memory leak in bignum selftest

This commit is contained in:
Manuel Pégourié-Gonnard 2014-01-20 10:03:15 +01:00 committed by Paul Bakker
parent 7fd620b331
commit d220f8b709

View file

@ -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 )