From: Anton Khirnov Date: Sat, 7 Feb 2026 17:47:16 +0000 (+0100) Subject: indexopts: avoid a memleak in the error path X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=HEAD;p=notmuch indexopts: avoid a memleak in the error path --- 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