diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-08-14 15:02:25 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-08-14 15:02:25 +0000 |
commit | 52596c339bf27015d2b1fdf3dc8dd9ae55be8bb3 (patch) | |
tree | aa64aad16d1eb5b3acb28d5b0466a19b3d1813f6 | |
parent | 73500267eec76480432186c14041ef7d296dfb1f (diff) |
return failure when the host cache creation fails
-rw-r--r-- | lib/easy.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/easy.c b/lib/easy.c index ff756784e..9ad2be40c 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -243,9 +243,16 @@ CURLcode curl_easy_perform(CURL *curl) data->hostcache = Curl_global_host_cache_get(); } - if (!data->hostcache) + if (!data->hostcache) { data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo); + if(!data->hostcache) + /* While we possibly could survive and do good without a host cache, + the fact that creating it failed indicates that things are truly + screwed up and we should bail out! */ + return CURLE_OUT_OF_MEMORY; + } + } return Curl_perform(data); |