mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Correct memory leak in RSA self test
The RSA self test didn't free the RSA context on failure.
This commit is contained in:
		
							parent
							
								
									88ec2381d6
								
							
						
					
					
						commit
						5bc8729b9e
					
				@ -1772,7 +1772,8 @@ int mbedtls_rsa_self_test( int verbose )
 | 
			
		||||
        if( verbose != 0 )
 | 
			
		||||
            mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
        return( 1 );
 | 
			
		||||
        ret = 1;
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if( verbose != 0 )
 | 
			
		||||
@ -1786,7 +1787,8 @@ int mbedtls_rsa_self_test( int verbose )
 | 
			
		||||
        if( verbose != 0 )
 | 
			
		||||
            mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
        return( 1 );
 | 
			
		||||
        ret = 1;
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if( verbose != 0 )
 | 
			
		||||
@ -1799,7 +1801,8 @@ int mbedtls_rsa_self_test( int verbose )
 | 
			
		||||
        if( verbose != 0 )
 | 
			
		||||
            mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
        return( 1 );
 | 
			
		||||
        ret = 1;
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if( memcmp( rsa_decrypted, rsa_plaintext, len ) != 0 )
 | 
			
		||||
@ -1807,7 +1810,8 @@ int mbedtls_rsa_self_test( int verbose )
 | 
			
		||||
        if( verbose != 0 )
 | 
			
		||||
            mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
        return( 1 );
 | 
			
		||||
        ret = 1;
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if( verbose != 0 )
 | 
			
		||||
@ -1825,7 +1829,8 @@ int mbedtls_rsa_self_test( int verbose )
 | 
			
		||||
        if( verbose != 0 )
 | 
			
		||||
            mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
        return( 1 );
 | 
			
		||||
        ret = 1;
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if( verbose != 0 )
 | 
			
		||||
@ -1837,7 +1842,8 @@ int mbedtls_rsa_self_test( int verbose )
 | 
			
		||||
        if( verbose != 0 )
 | 
			
		||||
            mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
        return( 1 );
 | 
			
		||||
        ret = 1;
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if( verbose != 0 )
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user