better bailing out in case of no memory

This commit is contained in:
Daniel Stenberg 2004-05-13 15:17:07 +00:00
parent 5bf02b16a0
commit 54cd2bee58

View File

@ -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__)