From: Howard Chu Date: Fri, 5 Dec 2008 09:00:24 +0000 (+0000) Subject: ITS#5849 free peer cert after retrieving DN X-Git-Tag: ACLCHECK_0~1034 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=187efdad6cce9d809697529f4cff52b4d384d988;p=openldap ITS#5849 free peer cert after retrieving DN --- diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 9b008ddb9c..7bba905124 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -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 */ diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c index 62c9638f07..f90eed2597 100644 --- a/libraries/libldap/tls_o.c +++ b/libraries/libldap/tls_o.c @@ -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; }