use more ad-hoc list handling function, and avoid to muck with ->next
[apps/madmutt.git] / lib-mime / rfc2231.c
index bf05bef..b5a2553 100644 (file)
@@ -140,9 +140,8 @@ static void purge_empty_parameters(PARAMETER **headp)
         PARAMETER *p = *headp;
 
         if (!p->attribute || !p->value) {
-            *headp = p->next;
-            p->next = NULL;
-            parameter_list_wipe(&p);
+            p = parameter_list_pop(headp);
+            parameter_delete(&p);
         } else {
             headp = &(*headp)->next;
         }