From 293c3dae6dce53b03b5149f097009c147644e0e3 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Fri, 10 May 2019 15:53:03 +0100 Subject: [PATCH] Remove redundant memset() The preceding calloc() already zeroizes that memory area, therfore the memset() is not necessary. Compilers are likely to optimize this out, but it still can be confusing to readers. --- library/x509_crt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/library/x509_crt.c b/library/x509_crt.c index 047e4e6e2..f58b15694 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -1858,7 +1858,6 @@ int mbedtls_x509_parse_subject_alternative_name( const mbedtls_x509_crt *crt, if( prev_san != NULL ) prev_san->next = cur_san; - memset( cur_san, 0, sizeof( mbedtls_x509_subject_alternative_name ) ); cur_san->type = MBEDTLS_X509_SAN_DNS_NAME; memcpy( &cur_san->san.unstructured_name,