mirror of
https://github.com/curl/curl.git
synced 2026-08-25 04:53:31 +03:00
Fixed an OOM problem with file: URLs
Moved Curl_file_connect into the protocol handler struct.
This commit is contained in:
parent
9b15f1be26
commit
59b05ac383
4 changed files with 15 additions and 11 deletions
10
lib/url.c
10
lib/url.c
|
|
@ -3638,10 +3638,12 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
* file: is a special case in that it doesn't need a network connection
|
||||
***********************************************************************/
|
||||
#ifndef CURL_DISABLE_FILE
|
||||
if (strequal(conn->protostr, "FILE")) {
|
||||
if(conn->protocol & PROT_FILE) {
|
||||
bool done;
|
||||
/* this is supposed to be the connect function so we better at least check
|
||||
that the file is present here! */
|
||||
result = Curl_file_connect(conn);
|
||||
DEBUGASSERT(conn->handler->connect_it);
|
||||
result = conn->handler->connect_it(conn, &done);
|
||||
|
||||
/* Setup a "faked" transfer that'll do nothing */
|
||||
if(CURLE_OK == result) {
|
||||
|
|
@ -3652,8 +3654,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
|
||||
result = setup_range(data);
|
||||
if(result) {
|
||||
if(conn->handler->done)
|
||||
result = conn->handler->done(conn, result, FALSE);
|
||||
DEBUGASSERT(conn->handler->done);
|
||||
conn->handler->done(conn, result, FALSE);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue