X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fnotify_email.c;h=0aed27f12bb2ac8b41b5fa4e80d586e0c71f8bca;hb=refs%2Fheads%2Fsh%2Fcollectd-4.9;hp=10d5ab1bd0683abdaf27872a97dd24031347ab73;hpb=a12cb627513a24de25401d3e0e29763db724bf5c;p=collectd.git diff --git a/src/notify_email.c b/src/notify_email.c index 10d5ab1b..0aed27f1 100644 --- a/src/notify_email.c +++ b/src/notify_email.c @@ -272,6 +272,12 @@ static int notify_email_notification (const notification_t *n, pthread_mutex_lock (&session_lock); + if (session == NULL) { + /* Initialization failed or we're in the process of shutting down. */ + pthread_mutex_unlock (&session_lock); + return (-1); + } + if (!(message = smtp_add_message (session))) { pthread_mutex_unlock (&session_lock); ERROR ("notify_email plugin: cannot set SMTP message");