1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 00:28:48 -05:00

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

View File

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