-#ifndef OPENSSL_NO_KRB5
- dest->krb5_client_princ_len = src->krb5_client_princ_len;
- if (src->krb5_client_princ_len > 0)
- memcpy(dest->krb5_client_princ, src->krb5_client_princ,
- src->krb5_client_princ_len);
+ /*
+ * Set the various pointers to NULL so that we can call SSL_SESSION_free in
+ * the case of an error whilst halfway through constructing dest
+ */
+ dest->ciphers = NULL;
+#ifndef OPENSSL_NO_TLSEXT
+ dest->tlsext_hostname = NULL;
+ dest->tlsext_tick = NULL;