+static void mutt_group_remove (group_t *g)
+{
+ if (!g)
+ return;
+ hash_delete (Groups, g->name, g, NULL);
+ rfc822_free_address (&g->as);
+ mutt_free_rx_list (&g->rs);
+ FREE(&g->name);
+ FREE(&g);
+}
+
+int mutt_group_context_clear (group_context_t **ctx)
+{
+ group_context_t *t;
+ for ( ; ctx && *ctx; (*ctx) = t)
+ {
+ mutt_group_remove ((*ctx)->g);
+ t = (*ctx)->next;
+ FREE(ctx); /* __FREE_CHECKED__ */
+ }
+ return 0;
+}
+
+static int empty_group (group_t *g)
+{
+ if (!g)
+ return -1;
+ return !g->as && !g->rs;
+}
+