]> granicus.if.org Git - neomutt/commitdiff
Tidy Address free'ing functions
authorPietro Cerutti <gahr@gahr.ch>
Mon, 13 May 2019 12:13:22 +0000 (12:13 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 23 May 2019 10:57:09 +0000 (11:57 +0100)
address/address.c

index cb0215fcbd210beca807fe53b20c50ea22d91618..4ad938919a51c153b994685beb45e30b2cbfdfa1 100644 (file)
@@ -381,7 +381,7 @@ static void add_addrspec(struct AddressList *al, const char *phrase,
 
   if (!parse_addr_spec(phrase, comment, commentlen, commentmax, cur))
   {
-    mutt_addr_free(&cur);
+    free_address(&cur);
     return;
   }
 
@@ -441,11 +441,7 @@ void mutt_addr_free(struct Address **p)
     return;
 
   struct AddressList *al = mutt_addr_to_addresslist(*p);
-  struct AddressNode *an, *tmp;
-  TAILQ_FOREACH_SAFE(an, al, entries, tmp)
-  {
-    mutt_addresslist_free_one(al, an);
-  }
+  mutt_addresslist_free(&al);
 }
 
 /**
@@ -581,7 +577,7 @@ struct Address *mutt_addr_parse_list(struct Address *top, const char *s)
         if (!s)
         {
           mutt_addresslist_free(&al);
-          mutt_addr_free(&a);
+          free_address(&a);
           return NULL;
         }
         mutt_addresslist_append(al, a);