required */
static CURLcode imap_init(struct connectdata *conn)
{
+ CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct IMAP *imap = data->state.proto.imap;
if(!imap) {
imap = data->state.proto.imap = calloc(sizeof(struct IMAP), 1);
if(!imap)
- return CURLE_OUT_OF_MEMORY;
+ result = CURLE_OUT_OF_MEMORY;
}
- return CURLE_OK;
+ return result;
}
/* For the IMAP "protocol connect" and "doing" phases only */
required */
static CURLcode pop3_init(struct connectdata *conn)
{
+ CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct POP3 *pop3 = data->state.proto.pop3;
if(!pop3) {
pop3 = data->state.proto.pop3 = calloc(sizeof(struct POP3), 1);
if(!pop3)
- return CURLE_OUT_OF_MEMORY;
+ result = CURLE_OUT_OF_MEMORY;
}
- return CURLE_OK;
+ return result;
}
/* For the POP3 "protocol connect" and "doing" phases only */
required */
static CURLcode smtp_init(struct connectdata *conn)
{
+ CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct SMTP *smtp = data->state.proto.smtp;
if(!smtp) {
smtp = data->state.proto.smtp = calloc(sizeof(struct SMTP), 1);
if(!smtp)
- return CURLE_OUT_OF_MEMORY;
+ result = CURLE_OUT_OF_MEMORY;
}
- return CURLE_OK;
+ return result;
}
/* For the SMTP "protocol connect" and "doing" phases only */