X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fsmtp%2Fserv_smtpeventclient.c;h=f08efde76e61ce1419281bf33267167ccaddf67c;hb=eb5939e86efacfbbdab2705e3fbce52223af38a7;hp=4b6dea3954c39c48cb681eb066e02f442754d8bd;hpb=320e203bbe6a3505117854136d58494f09fbcf43;p=citadel.git diff --git a/citadel/modules/smtp/serv_smtpeventclient.c b/citadel/modules/smtp/serv_smtpeventclient.c index 4b6dea395..f08efde76 100644 --- a/citadel/modules/smtp/serv_smtpeventclient.c +++ b/citadel/modules/smtp/serv_smtpeventclient.c @@ -530,6 +530,8 @@ SmtpOutMsg *new_smtp_outmsg(OneQueItem *MyQItem, SmtpOutMsg * Msg; Msg = (SmtpOutMsg *) malloc(sizeof(SmtpOutMsg)); + if (Msg == NULL) + return NULL; memset(Msg, 0, sizeof(SmtpOutMsg)); Msg->n = MsgCount; @@ -567,6 +569,12 @@ void smtp_try_one_queue_entry(OneQueItem *MyQItem, SMTPC_syslog(LOG_DEBUG, "%s\n", __FUNCTION__); Msg = new_smtp_outmsg(MyQItem, MyQEntry, MsgCount); + if (Msg == NULL) { + SMTPC_syslog(LOG_DEBUG, "%s Failed to alocate message context.\n", __FUNCTION__); + if (KeepMsgText) + FreeStrBuf (&MsgText); + return; + } if (KeepMsgText) Msg->msgtext = MsgText; else Msg->msgtext = NewStrBufDup(MsgText); @@ -600,8 +608,7 @@ void smtp_try_one_queue_entry(OneQueItem *MyQItem, } else { /* No recipients? well fail then. */ - if ((Msg==NULL) || - (Msg->MyQEntry == NULL)) { + if (Msg->MyQEntry == NULL) { Msg->MyQEntry->Status = 5; StrBufPlain(Msg->MyQEntry->StatusMessage, HKEY("Invalid Recipient!"));