Introduced x509_crt_init(), x509_crl_init() and x509_csr_init()
diff --git a/library/x509_crl.c b/library/x509_crl.c
index 1a10bc4..e327726 100644
--- a/library/x509_crl.c
+++ b/library/x509_crl.c
@@ -279,7 +279,7 @@
         }
 
         crl = crl->next;
-        memset( crl, 0, sizeof( x509_crl ) );
+        x509_crl_init( crl );
     }
 
 #if defined(POLARSSL_PEM_PARSE_C)
@@ -514,7 +514,7 @@
         }
 
         crl = crl->next;
-        memset( crl, 0, sizeof( x509_crl ) );
+        x509_crl_init( crl );
 
         return( x509parse_crl( crl, buf, buflen ) );
     }
@@ -680,6 +680,14 @@
 }
 
 /*
+ * Initialize a CRL chain
+ */
+void x509_crl_init( x509_crl *crl )
+{
+    memset( crl, 0, sizeof(x509_crl) );
+}
+
+/*
  * Unallocate all CRL data
  */
 void x509_crl_free( x509_crl *crl )
diff --git a/library/x509_crt.c b/library/x509_crt.c
index f57fddc..f73724e 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -785,7 +785,7 @@
 
         prev = crt;
         crt = crt->next;
-        memset( crt, 0, sizeof( x509_cert ) );
+        x509_crt_init( crt );
     }
 
     if( ( ret = x509parse_crt_der_core( crt, buf, buflen ) ) != 0 )
@@ -1603,6 +1603,14 @@
 }
 
 /*
+ * Initialize a certificate chain
+ */
+void x509_crt_init( x509_cert *crt )
+{
+    memset( crt, 0, sizeof(x509_cert) );
+}
+
+/*
  * Unallocate all certificate data
  */
 void x509_crt_free( x509_cert *crt )
diff --git a/library/x509_csr.c b/library/x509_csr.c
index 30cd1c1..65bc63c 100644
--- a/library/x509_csr.c
+++ b/library/x509_csr.c
@@ -103,7 +103,7 @@
     if( csr == NULL || buf == NULL )
         return( POLARSSL_ERR_X509_BAD_INPUT_DATA );
 
-    memset( csr, 0, sizeof( x509_csr ) );
+    x509_csr_init( csr );
 
 #if defined(POLARSSL_PEM_PARSE_C)
     pem_init( &pem );
@@ -406,6 +406,14 @@
 }
 
 /*
+ * Initialize a CSR
+ */
+void x509_csr_init( x509_csr *csr )
+{
+    memset( csr, 0, sizeof(x509_csr) );
+}
+
+/*
  * Unallocate all CSR data
  */
 void x509_csr_free( x509_csr *csr )