I don't know how libesmtp handles NULL pointers and I don't want to take
my chances.
pthread_mutex_lock (&session_lock);
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");
if (!(message = smtp_add_message (session))) {
pthread_mutex_unlock (&session_lock);
ERROR ("notify_email plugin: cannot set SMTP message");