aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-01-31 19:47:49 +0000
committerYang Tse <yangsita@gmail.com>2007-01-31 19:47:49 +0000
commit49c4d9c9cd6ef5354ea68e8ace79fbe3cc5eae9d (patch)
treee05c4dac0b0b9513411ce06088e5b8eec6e7143a /lib/url.c
parentc2639e07388464dd920fe239358458e42658b278 (diff)
add debug messages for initialization failures
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index bc896b39d..63c93f1b1 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -485,14 +485,17 @@ CURLcode Curl_open(struct SessionHandle **curl)
/* Very simple start-up: alloc the struct, init it with zeroes and return */
data = (struct SessionHandle *)calloc(1, sizeof(struct SessionHandle));
- if(!data)
+ if(!data) {
/* this is a very serious error */
+ DEBUGF(fprintf(stderr, "Error: calloc of SessionHandle failed\n"));
return CURLE_OUT_OF_MEMORY;
+ }
data->magic = CURLEASY_MAGIC_NUMBER;
#ifdef USE_ARES
if(ARES_SUCCESS != ares_init(&data->state.areschannel)) {
+ DEBUGF(fprintf(stderr, "Error: ares_init failed\n"));
free(data);
return CURLE_FAILED_INIT;
}
@@ -503,8 +506,10 @@ CURLcode Curl_open(struct SessionHandle **curl)
/* We do some initial setup here, all those fields that can't be just 0 */
data->state.headerbuff=(char*)malloc(HEADERSIZE);
- if(!data->state.headerbuff)
+ if(!data->state.headerbuff) {
+ DEBUGF(fprintf(stderr, "Error: malloc of headerbuff failed\n"));
res = CURLE_OUT_OF_MEMORY;
+ }
else {
data->state.headersize=HEADERSIZE;