]> diplodocus.org Git - nmh/blobdiff - sbr/context_del.c
Escape literal leading full stop in man/new.man.
[nmh] / sbr / context_del.c
index e6cdc73dddd6a0090cf757a4f972754054660522..37cbce00cf86e476d743594d74a624f33c313dbd 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <h/mh.h>
+#include <h/utils.h>
 
 /*
  * Delete a key/value pair from the context/profile list.
@@ -17,7 +18,7 @@
 int
 context_del (char *key)
 {
-    register struct node *np, *pp;
+    struct node *np, *pp;
 
     for (np = m_defs, pp = NULL; np; pp = np, np = np->n_next) {
        if (!strcasecmp (np->n_name ? np->n_name : "", key ? key : "")) {
@@ -28,9 +29,8 @@ context_del (char *key)
            else
                m_defs = np->n_next;
            free (np->n_name);
-           if (np->n_field)
-               free (np->n_field);
-           free ((char *) np);
+            mh_xfree(np->n_field);
+           free(np);
            ctxflags |= CTXMOD;
            return 0;
        }