mirror of
https://github.com/curl/curl.git
synced 2024-12-15 06:40:09 +08:00
ldap: only set the callback ptr for TLS context when TLS is used
Follow-up to a5eee22e59
Fixes #6804
Closes #6805
This commit is contained in:
parent
85e6975643
commit
8cbc16b2f9
@ -365,13 +365,14 @@ static CURLcode ldap_disconnect(struct Curl_easy *data,
|
||||
{
|
||||
struct ldapconninfo *li = conn->proto.ldapc;
|
||||
(void) dead_connection;
|
||||
(void) data;
|
||||
|
||||
if(li) {
|
||||
if(li->ld) {
|
||||
Sockbuf *sb;
|
||||
ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb);
|
||||
ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, data);
|
||||
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);
|
||||
}
|
||||
ldap_unbind_ext(li->ld, NULL, NULL);
|
||||
li->ld = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user