mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
better bailing out in case of no memory
This commit is contained in:
parent
5bf02b16a0
commit
54cd2bee58
@ -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…
Reference in New Issue
Block a user