From: Wilfried Goesgens Date: Tue, 19 Apr 2011 19:50:55 +0000 (+0000) Subject: Fix Crash X-Git-Tag: v8.11~1078 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=d889a620a01f72a02bc6c098a0c9269cdaadb9cc;p=citadel.git Fix Crash * check pointer before accessing it * fix probably uninitialized case --- diff --git a/citadel/modules/smtp/serv_smtpeventclient.c b/citadel/modules/smtp/serv_smtpeventclient.c index a2913bb9b..85ef2813b 100644 --- a/citadel/modules/smtp/serv_smtpeventclient.c +++ b/citadel/modules/smtp/serv_smtpeventclient.c @@ -170,8 +170,9 @@ eNextState FailOneAttempt(AsyncIO *IO) * possible ways here: * - connection timeout * - - */ - SendMsg->pCurrRelay = SendMsg->pCurrRelay->Next; + */ + if (SendMsg->pCurrRelay != NULL) + SendMsg->pCurrRelay = SendMsg->pCurrRelay->Next; if (SendMsg->pCurrRelay == NULL) return eAbort; @@ -494,8 +495,10 @@ void smtp_try_one_queue_entry(OneQueItem *MyQItem, void SMTPSetTimeout(eNextState NextTCPState, SmtpOutMsg *pMsg) { + double Timeout = 0.0; + CtdlLogPrintf(CTDL_DEBUG, "SMTP: %s\n", __FUNCTION__); - double Timeout; + switch (NextTCPState) { case eSendReply: case eSendMore: