Introduced x509_crt_init(), x509_crl_init() and x509_csr_init()
diff --git a/programs/x509/cert_app.c b/programs/x509/cert_app.c
index add75a0..160e65d 100644
--- a/programs/x509/cert_app.c
+++ b/programs/x509/cert_app.c
@@ -168,8 +168,8 @@
      * Set to sane values
      */
     server_fd = 0;
-    memset( &cacert, 0, sizeof( x509_cert ) );
-    memset( &clicert, 0, sizeof( x509_cert ) );
+    x509_crt_init( &cacert );
+    x509_crt_init( &clicert );
     pk_init( &pkey );
 
     if( argc == 0 )
@@ -269,7 +269,7 @@
     {
         x509_cert crt;
         x509_cert *cur = &crt;
-        memset( &crt, 0, sizeof( x509_cert ) );
+        x509_crt_init( &crt );
 
         /*
          * 1.1. Load the certificate(s)
diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c
index 84b12f6..c50cf81 100644
--- a/programs/x509/cert_write.c
+++ b/programs/x509/cert_write.c
@@ -208,9 +208,9 @@
     pk_init( &loaded_subject_key );
     mpi_init( &serial );
 #if defined(POLARSSL_X509_CSR_PARSE_C)
-    memset( &csr, 0, sizeof(x509_csr) );
+    x509_csr_init( &csr );
 #endif
-    memset( &issuer_crt, 0, sizeof(x509_cert) );
+    x509_crt_init( &issuer_crt );
     memset( buf, 0, 1024 );
 
     if( argc == 0 )
diff --git a/programs/x509/crl_app.c b/programs/x509/crl_app.c
index 1cb9828..2213f81 100644
--- a/programs/x509/crl_app.c
+++ b/programs/x509/crl_app.c
@@ -76,7 +76,7 @@
     /*
      * Set to sane values
      */
-    memset( &crl, 0, sizeof( x509_crl ) );
+    x509_crl_init( &crl );
 
     if( argc == 0 )
     {
diff --git a/programs/x509/req_app.c b/programs/x509/req_app.c
index 5e05d60..3d35524 100644
--- a/programs/x509/req_app.c
+++ b/programs/x509/req_app.c
@@ -76,7 +76,7 @@
     /*
      * Set to sane values
      */
-    memset( &csr, 0, sizeof( x509_csr ) );
+    x509_csr_init( &csr );
 
     if( argc == 0 )
     {