]> granicus.if.org Git - neomutt/commitdiff
Fix free_opt for regex 1052/head
authorPietro Cerutti <gahr@gahr.ch>
Fri, 9 Feb 2018 09:03:12 +0000 (09:03 +0000)
committerPietro Cerutti <gahr@gahr.ch>
Fri, 9 Feb 2018 09:03:12 +0000 (09:03 +0000)
init.c

diff --git a/init.c b/init.c
index 7010daac0cdc8f614a06c3dcacb919244667871c..cd518c617e9a9ee015bb87b10d8317b840ffcfc8 100644 (file)
--- 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: