mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05: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