aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-08-01 09:25:50 -0300
committerDavid Bremner <david@tethera.net>2020-08-03 20:45:58 -0300
commit31dab9b1cd66c7f285fe86021f66940f679325d4 (patch)
treeffa42a588d39efd1db30379f9df9ce751afd39c1 /lib
parent3f8b01a3ef9e50a772897c67e0146172b3849749 (diff)
lib: return NULL from n_d_get_default_indexopts on error
This is a rare and probably serious programming error, so better not to silently return a default value.
Diffstat (limited to 'lib')
-rw-r--r--lib/indexopts.c2
-rw-r--r--lib/notmuch.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/indexopts.c b/lib/indexopts.c
index 1e8d180e..82a0026f 100644
--- a/lib/indexopts.c
+++ b/lib/indexopts.c
@@ -32,7 +32,7 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
char *decrypt_policy;
notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt_policy);
if (err)
- return ret;
+ return NULL;
if (decrypt_policy) {
if ((! (strcasecmp (decrypt_policy, "true"))) ||
diff --git a/lib/notmuch.h b/lib/notmuch.h
index f9e9cc41..aaf92470 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -2320,6 +2320,7 @@ notmuch_config_list_destroy (notmuch_config_list_t *config_list);
* added to the index. At the moment it is a featureless stub.
*
* @since libnotmuch 5.1 (notmuch 0.26)
+ * @retval NULL in case of error
*/
notmuch_indexopts_t *
notmuch_database_get_default_indexopts (notmuch_database_t *db);