projects
/
notmuch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a4992b
)
Fix missing error check.
author
Carl Worth
<cworth@cworth.org>
Thu, 22 Oct 2009 22:33:56 +0000
(15:33 -0700)
committer
Carl Worth
<cworth@cworth.org>
Thu, 22 Oct 2009 22:33:56 +0000
(15:33 -0700)
The notmuch_message_file_open function is perfectly capable of
returning NULL. So check for it.
database.cc
patch
|
blob
|
history
diff --git
a/database.cc
b/database.cc
index 578dce4b70c2d1740bb57f5c34a6f4a7b0c10214..1c0410c2c176a24f4897a33a70f945129c617aa9 100644
(file)
--- 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",