aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2026-02-07 18:47:16 +0100
committerDavid Bremner <david@tethera.net>2026-02-08 09:19:36 +0900
commit7557b6a1d47b5caa8dfced9d210d4d552b795c14 (patch)
treeb9a199113d9efdcd17daab506b5b40053fbcb93f
parent01c03582bf176f5d2eec913437b55849c1bd04ec (diff)
indexopts: avoid a memleak in the error path
-rw-r--r--lib/indexopts.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/indexopts.c b/lib/indexopts.c
index 2ffd1942..da378700 100644
--- a/lib/indexopts.c
+++ b/lib/indexopts.c
@@ -37,7 +37,7 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt_policy);
if (err)
- return NULL;
+ goto FAIL;
if (decrypt_policy) {
if ((! (strcasecmp (decrypt_policy, "true"))) ||
@@ -54,6 +54,10 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
free (decrypt_policy);
return ret;
+
+FAIL:
+ talloc_free (ret);
+ return NULL;
}
notmuch_status_t