Removed redundant free()s

(cherry picked from commit 1fc7dfe2e2)
This commit is contained in:
Paul Bakker 2013-06-24 19:32:04 +02:00
parent cf445ffc4e
commit 72823091c2

View file

@ -2330,10 +2330,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-----",
@ -2351,10 +2348,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-----",
@ -2373,10 +2367,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);