ITS#5849 free peer cert after retrieving DN

This commit is contained in:
Howard Chu 2008-12-05 09:00:24 +00:00
parent 65530005ee
commit 187efdad6c
2 changed files with 3 additions and 0 deletions

View File

@ -1735,6 +1735,7 @@ tls_get_cert_dn( tls_session *session, struct berval *dnbv )
xn = X509_get_subject_name(x);
dnbv->bv_len = i2d_X509_NAME( xn, NULL );
dnbv->bv_val = xn->bytes->data;
X509_free(x);
return 0;
}
#endif /* HAVE_GNUTLS */

View File

@ -452,6 +452,7 @@ tlso_session_my_dn( tls_session *sess, struct berval *der_dn )
xn = X509_get_subject_name(x);
der_dn->bv_len = i2d_X509_NAME( xn, NULL );
der_dn->bv_val = xn->bytes->data;
X509_free(x);
return 0;
}
@ -478,6 +479,7 @@ tlso_session_peer_dn( tls_session *sess, struct berval *der_dn )
xn = X509_get_subject_name(x);
der_dn->bv_len = i2d_X509_NAME( xn, NULL );
der_dn->bv_val = xn->bytes->data;
X509_free(x);
return 0;
}