From: Pietro Cerutti Date: Fri, 9 Feb 2018 09:03:12 +0000 (+0000) Subject: Fix free_opt for regex X-Git-Tag: neomutt-20180223~13^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfb76c58bea9ff166af53e384e349d9d65fc5a37;p=neomutt Fix free_opt for regex --- diff --git a/init.c b/init.c index 7010daac0..cd518c617 100644 --- a/init.c +++ b/init.c @@ -693,21 +693,13 @@ int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags) static void free_opt(struct Option *p) { - struct Regex **pp = NULL; - switch (DTYPE(p->type)) { case DT_ADDRESS: mutt_addr_free((struct Address **) p->var); break; case DT_REGEX: - pp = (struct Regex **) p->var; - FREE(&(*pp)->pattern); - if ((*pp)->regex) - { - regfree((*pp)->regex); - FREE(&(*pp)->regex); - } + mutt_regex_free((struct Regex **) p->var); break; case DT_PATH: case DT_STRING: