mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:01:41 +03:00
openldap: fix memory-leak on oldap_do's exit path
On SSL sockbuf setup failure in `oldap_do`, the 'lud' data would not be freed and instead leak. Reported-by: Joshua Rogers Closes #18986
This commit is contained in:
parent
d35bdfa8f2
commit
be5a5c10d4
1 changed files with 3 additions and 1 deletions
|
|
@ -988,8 +988,10 @@ static CURLcode oldap_do(struct Curl_easy *data, bool *done)
|
|||
Sockbuf *sb;
|
||||
/* re-install the libcurl SSL handlers into the sockbuf. */
|
||||
if((ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb) != LDAP_OPT_SUCCESS) ||
|
||||
ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, data))
|
||||
ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, data)) {
|
||||
ldap_free_urldesc(lud);
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue