openldap: protect SSL-specific code with proper #ifdef

Closes #6901
This commit is contained in:
Daniel Stenberg 2021-04-15 22:47:09 +02:00
parent b532d35b5c
commit 2cd2686129
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 2 additions and 0 deletions

View File

@ -368,11 +368,13 @@ static CURLcode ldap_disconnect(struct Curl_easy *data,
if(li) {
if(li->ld) {
#ifdef USE_SSL
if(conn->ssl[FIRSTSOCKET].use) {
Sockbuf *sb;
ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb);
ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, data);
}
#endif
ldap_unbind_ext(li->ld, NULL, NULL);
li->ld = NULL;
}