mirror of
https://github.com/curl/curl.git
synced 2026-07-23 03:57:16 +03:00
better bailing out in case of no memory
This commit is contained in:
parent
5bf02b16a0
commit
54cd2bee58
1 changed files with 7 additions and 2 deletions
|
|
@ -107,10 +107,15 @@ CURLcode Curl_file_connect(struct connectdata *conn)
|
|||
char *actual_path;
|
||||
#endif
|
||||
|
||||
file = (struct FILEPROTO *)calloc(sizeof(struct FILEPROTO), 1);
|
||||
if(!file)
|
||||
if(!real_path)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
file = (struct FILEPROTO *)calloc(sizeof(struct FILEPROTO), 1);
|
||||
if(!file) {
|
||||
free(real_path);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
conn->proto.file = file;
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue