From 85dfe08b31275aca89e886369285d8d2e18a3c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 10 Sep 2013 15:59:02 +0200 Subject: [PATCH] Merge duplicated else/#else branch --- library/x509parse.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/library/x509parse.c b/library/x509parse.c index 2290b7b4c..fc84e6164 100644 --- a/library/x509parse.c +++ b/library/x509parse.c @@ -1697,6 +1697,7 @@ int x509parse_csr( x509_csr *csr, const unsigned char *buf, size_t buflen ) return( ret ); } else +#endif { /* * nope, copy the raw DER data @@ -1710,16 +1711,6 @@ int x509parse_csr( x509_csr *csr, const unsigned char *buf, size_t buflen ) buflen = 0; } -#else - p = (unsigned char *) polarssl_malloc( len = buflen ); - - if( p == NULL ) - return( POLARSSL_ERR_X509_MALLOC_FAILED ); - - memcpy( p, buf, buflen ); - - buflen = 0; -#endif csr->raw.p = p; csr->raw.len = len; @@ -1926,6 +1917,7 @@ int x509parse_crl( x509_crl *chain, const unsigned char *buf, size_t buflen ) return( ret ); } else +#endif { /* * nope, copy the raw DER data @@ -1939,16 +1931,6 @@ int x509parse_crl( x509_crl *chain, const unsigned char *buf, size_t buflen ) buflen = 0; } -#else - p = (unsigned char *) polarssl_malloc( len = buflen ); - - if( p == NULL ) - return( POLARSSL_ERR_X509_MALLOC_FAILED ); - - memcpy( p, buf, buflen ); - - buflen = 0; -#endif crl->raw.p = p; crl->raw.len = len;