summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a12cb62)
raw | patch | inline | side by side (parent: a12cb62)
author | Florian Forster <octo@huhu.verplant.org> | |
Sun, 5 Sep 2010 07:42:40 +0000 (09:42 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sun, 5 Sep 2010 07:42:40 +0000 (09:42 +0200) |
I don't know how libesmtp handles NULL pointers and I don't want to take
my chances.
my chances.
src/notify_email.c | patch | blob | history |
diff --git a/src/notify_email.c b/src/notify_email.c
index 10d5ab1bd0683abdaf27872a97dd24031347ab73..0aed27f12bb2ac8b41b5fa4e80d586e0c71f8bca 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
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");