mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:21:41 +03:00
openldap: fix memory-leak in error path
The 'ber' pointer could escape a free if an early error occurred. Reported-by: Joshua Rogers Closes #18985
This commit is contained in:
parent
6c0338115a
commit
d35bdfa8f2
1 changed files with 1 additions and 1 deletions
|
|
@ -1216,7 +1216,6 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
|
|||
break;
|
||||
}
|
||||
|
||||
ber_free(ber, 0);
|
||||
|
||||
if(!result)
|
||||
result = client_write(data, STRCONST("\n"), NULL, 0, NULL, 0);
|
||||
|
|
@ -1225,6 +1224,7 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
|
|||
break;
|
||||
}
|
||||
|
||||
ber_free(ber, 0);
|
||||
ldap_msgfree(msg);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue