Removed redundant free()s

This commit is contained in:
Paul Bakker 2013-06-17 15:57:02 +02:00
parent ff3a4b010b
commit 1fc7dfe2e2

View file

@ -2355,10 +2355,7 @@ int x509parse_key( rsa_context *rsa, const unsigned char *key, size_t keylen,
return( ret ); return( ret );
} }
else if( ret != POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT ) else if( ret != POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT )
{
pem_free( &pem );
return( ret ); return( ret );
}
ret = pem_read_buffer( &pem, ret = pem_read_buffer( &pem,
"-----BEGIN PRIVATE KEY-----", "-----BEGIN PRIVATE KEY-----",
@ -2376,10 +2373,7 @@ int x509parse_key( rsa_context *rsa, const unsigned char *key, size_t keylen,
return( ret ); return( ret );
} }
else if( ret != POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT ) else if( ret != POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT )
{
pem_free( &pem );
return( ret ); return( ret );
}
ret = pem_read_buffer( &pem, ret = pem_read_buffer( &pem,
"-----BEGIN ENCRYPTED PRIVATE KEY-----", "-----BEGIN ENCRYPTED PRIVATE KEY-----",
@ -2398,10 +2392,7 @@ int x509parse_key( rsa_context *rsa, const unsigned char *key, size_t keylen,
return( ret ); return( ret );
} }
else if( ret != POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT ) else if( ret != POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT )
{
pem_free( &pem );
return( ret ); return( ret );
}
#else #else
((void) pwd); ((void) pwd);
((void) pwdlen); ((void) pwdlen);