]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/tls_o.c
Silence warning in print_deref(): cast lutil_b64_ntop() arg to unsigned char*
[openldap] / libraries / libldap / tls_o.c
index fc4f9bc3d6d44113aab80b831b2ae2a53ae28fdb..fc49529f927e095ee12e93a8fb030295a2515a99 100644 (file)
@@ -421,7 +421,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);
+       /* Don't X509_free, the session is still using it */
        return 0;
 }
 
@@ -494,7 +494,7 @@ tlso_session_chkhost( LDAP *ld, tls_session *sess, const char *name_in )
 #ifdef LDAP_PF_INET6
        if (name[0] == '[' && strchr(name, ']')) {
                char *n2 = ldap_strdup(name+1);
-               *strchr(n2, ']') = 2;
+               *strchr(n2, ']') = 0;
                if (inet_pton(AF_INET6, n2, &addr))
                        ntype = IS_IP6;
                LDAP_FREE(n2);