X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Ftls_o.c;h=338e5279696f2504500f939c6be102c44a8e02e8;hb=52a0b4f83c34de4966870af62db829c913993fdf;hp=183410a4b47a68d717bbfab184846649e4865f40;hpb=3743a5a68e4d608949d5fd04904733ee5c1ac959;p=openldap diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c index 183410a4b4..338e527969 100644 --- a/libraries/libldap/tls_o.c +++ b/libraries/libldap/tls_o.c @@ -501,12 +501,8 @@ 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, ']') = 0; - if (inet_pton(AF_INET6, n2, &addr)) - ntype = IS_IP6; - LDAP_FREE(n2); + if (inet_pton(AF_INET6, name, &addr)) { + ntype = IS_IP6; } else #endif if ((ptr = strrchr(name, '.')) && isdigit((unsigned char)ptr[1])) {