add debug messages for initialization failures
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user