From 7557b6a1d47b5caa8dfced9d210d4d552b795c14 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 7 Feb 2026 18:47:16 +0100 Subject: [PATCH] indexopts: avoid a memleak in the error path --- lib/indexopts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.45.2