]> git.sur5r.net Git - openldap/commitdiff
ITS#5849 free peer cert after retrieving DN
authorHoward Chu <hyc@openldap.org>
Fri, 5 Dec 2008 09:00:24 +0000 (09:00 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 5 Dec 2008 09:00:24 +0000 (09:00 +0000)
libraries/libldap/tls.c
libraries/libldap/tls_o.c

index 9b008ddb9ceda75440e823051cde6de4887433e0..7bba905124b7ae83387df6aaf1fa622b57d6bf86 100644 (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 */
index 62c9638f073326a96ec6f0296060a92cc64af9cd..f90eed2597666c1956c62f064e36949204575380 100644 (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;
 }