diff options
| author | Anton Khirnov <anton@khirnov.net> | 2026-02-07 18:47:16 +0100 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2026-02-08 09:19:36 +0900 |
| commit | 7557b6a1d47b5caa8dfced9d210d4d552b795c14 (patch) | |
| tree | b9a199113d9efdcd17daab506b5b40053fbcb93f /lib | |
| parent | 01c03582bf176f5d2eec913437b55849c1bd04ec (diff) | |
indexopts: avoid a memleak in the error path
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/indexopts.c | 6 |
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 |
