use more ad-hoc list handling function, and avoid to muck with ->next
[apps/madmutt.git] / lib-mime / rfc2231.c
index e1eec1e..b5a2553 100644 (file)
@@ -47,6 +47,7 @@
 #include <lib-mime/mime.h>
 
 #include "charset.h"
+#include "mutt.h"
 
 typedef struct rfc2231_param {
     struct rfc2231_param *next;
@@ -139,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;
         }