summaryrefslogtreecommitdiff
path: root/database.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-22 15:33:56 -0700
committerCarl Worth <cworth@cworth.org>2009-10-22 15:33:56 -0700
commit90f93fc9c7c6f0b86259c259ee9ba0eb08206b27 (patch)
tree7d113a1711a5be85372d0441a6f6fa4e1bb5fb42 /database.cc
parent6a4992bc611881b363583b4a20fc530c770aedd8 (diff)
Fix missing error check.
The notmuch_message_file_open function is perfectly capable of returning NULL. So check for it.
Diffstat (limited to 'database.cc')
-rw-r--r--database.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/database.cc b/database.cc
index 578dce4..1c0410c 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",