SmtpOutMsg * Msg;
Msg = (SmtpOutMsg *) malloc(sizeof(SmtpOutMsg));
+ if (Msg == NULL)
+ return NULL;
memset(Msg, 0, sizeof(SmtpOutMsg));
Msg->n = MsgCount;
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);
}
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!"));