From: Carl Worth Date: Thu, 22 Oct 2009 22:33:56 +0000 (-0700) Subject: Fix missing error check. X-Git-Tag: 0.1~773 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=90f93fc9c7c6f0b86259c259ee9ba0eb08206b27;p=notmuch.git Fix missing error check. The notmuch_message_file_open function is perfectly capable of returning NULL. So check for it. --- diff --git a/database.cc b/database.cc index 578dce4b..1c0410c2 100644 --- a/database.cc +++ b/database.cc @@ -502,6 +502,10 @@ notmuch_database_add_message (notmuch_database_t *notmuch, unsigned int i; message = notmuch_message_file_open (filename); + if (message == NULL) { + ret = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; + } notmuch_message_file_restrict_headers (message, "date",