diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2012-03-17 17:41:27 +0100 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-03-18 07:58:35 -0300 |
commit | ea54c4fdc7d0ed9a4d6ab328d44c10ce5668d587 (patch) | |
tree | 83f265ceb9d328d1b3d98358f2031c3b830d26cc /lib | |
parent | 622d2f6128a70ff010586a211d4b4af19650064b (diff) |
Fix error reporting in notmuch_database_find_message_by_filename
Formerly it was possible for *message_ret to be left
uninitialized. The documentation however clearly states that "[o]n any
failure or when the message is not found, this function initializes
'*message' to NULL".
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/database.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/database.cc b/lib/database.cc index 8f8df1a1..16c4354f 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1825,6 +1825,9 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch, if (message_ret == NULL) return NOTMUCH_STATUS_NULL_POINTER; + /* return NULL on any failure */ + *message_ret = NULL; + local = talloc_new (notmuch); try { |