From: Daniel Stenberg Date: Thu, 13 May 2004 15:17:07 +0000 (+0000) Subject: better bailing out in case of no memory X-Git-Tag: curl-7_12_0~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54cd2bee581ac5f544443d66c9951d1b88d7a583;p=thirdparty%2Fcurl.git better bailing out in case of no memory --- diff --git a/lib/file.c b/lib/file.c index 0edd3d972f..05a1fde58c 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;