mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Fix potential memory leak in bignum selftest
This commit is contained in:
		
							parent
							
								
									fd6a191381
								
							
						
					
					
						commit
						9e987edf9f
					
				@ -2195,7 +2195,8 @@ int mpi_self_test( int verbose )
 | 
				
			|||||||
        if( verbose != 0 )
 | 
					        if( verbose != 0 )
 | 
				
			||||||
            printf( "failed\n" );
 | 
					            printf( "failed\n" );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return( 1 );
 | 
					        ret = 1;
 | 
				
			||||||
 | 
					        goto cleanup;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( verbose != 0 )
 | 
					    if( verbose != 0 )
 | 
				
			||||||
@ -2220,7 +2221,8 @@ int mpi_self_test( int verbose )
 | 
				
			|||||||
        if( verbose != 0 )
 | 
					        if( verbose != 0 )
 | 
				
			||||||
            printf( "failed\n" );
 | 
					            printf( "failed\n" );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return( 1 );
 | 
					        ret = 1;
 | 
				
			||||||
 | 
					        goto cleanup;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( verbose != 0 )
 | 
					    if( verbose != 0 )
 | 
				
			||||||
@ -2241,7 +2243,8 @@ int mpi_self_test( int verbose )
 | 
				
			|||||||
        if( verbose != 0 )
 | 
					        if( verbose != 0 )
 | 
				
			||||||
            printf( "failed\n" );
 | 
					            printf( "failed\n" );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return( 1 );
 | 
					        ret = 1;
 | 
				
			||||||
 | 
					        goto cleanup;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( verbose != 0 )
 | 
					    if( verbose != 0 )
 | 
				
			||||||
@ -2262,7 +2265,8 @@ int mpi_self_test( int verbose )
 | 
				
			|||||||
        if( verbose != 0 )
 | 
					        if( verbose != 0 )
 | 
				
			||||||
            printf( "failed\n" );
 | 
					            printf( "failed\n" );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return( 1 );
 | 
					        ret = 1;
 | 
				
			||||||
 | 
					        goto cleanup;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( verbose != 0 )
 | 
					    if( verbose != 0 )
 | 
				
			||||||
@ -2276,15 +2280,16 @@ int mpi_self_test( int verbose )
 | 
				
			|||||||
        MPI_CHK( mpi_lset( &X, gcd_pairs[i][0] ) );
 | 
					        MPI_CHK( mpi_lset( &X, gcd_pairs[i][0] ) );
 | 
				
			||||||
        MPI_CHK( mpi_lset( &Y, gcd_pairs[i][1] ) );
 | 
					        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( mpi_cmp_int( &A, gcd_pairs[i][2] ) != 0 )
 | 
				
			||||||
	    {
 | 
					        {
 | 
				
			||||||
		    if( verbose != 0 )
 | 
					            if( verbose != 0 )
 | 
				
			||||||
			    printf( "failed at %d\n", i );
 | 
					                printf( "failed at %d\n", i );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		    return( 1 );
 | 
					            ret = 1;
 | 
				
			||||||
	    }
 | 
					            goto cleanup;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( verbose != 0 )
 | 
					    if( verbose != 0 )
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user