aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-13 15:17:07 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-13 15:17:07 +0000
commit54cd2bee581ac5f544443d66c9951d1b88d7a583 (patch)
treea6a7d6301f22b0d30b38447e93d47538f0cc73ff
parent5bf02b16a00cf0762b293e6df02f527838d7b5c9 (diff)
better bailing out in case of no memory
-rw-r--r--lib/file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/file.c b/lib/file.c
index 0edd3d972..05a1fde58 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -107,9 +107,14 @@ CURLcode Curl_file_connect(struct connectdata *conn)
char *actual_path;
#endif
+ if(!real_path)
+ return CURLE_OUT_OF_MEMORY;
+
file = (struct FILEPROTO *)calloc(sizeof(struct FILEPROTO), 1);
- if(!file)
+ if(!file) {
+ free(real_path);
return CURLE_OUT_OF_MEMORY;
+ }
conn->proto.file = file;