]> diplodocus.org Git - nmh/blobdiff - uip/mhparse.c
Replace mh_xmalloc() with mh_xstrdup().
[nmh] / uip / mhparse.c
index f43fd4945db8a54e6fe325da1f8f2355c8acbcb1..059d112cbdd9978b8b7325b11d681269a6dac786 100644 (file)
@@ -581,7 +581,7 @@ add_header (CT ct, char *name, char *value)
     HF hp;
 
     /* allocate header field structure */
-    hp = mh_xmalloc (sizeof(*hp));
+    NEW(hp);
 
     /* link data into header structure */
     hp->name = name;
@@ -3537,7 +3537,7 @@ bad_quote:
            }
 
            if (pp == NULL) {
-               pp = mh_xmalloc(sizeof(*pp));
+               NEW(pp);
                memset(pp, 0, sizeof(*pp));
                pp->name = nameptr;
                pp->next = phead;
@@ -3548,7 +3548,7 @@ bad_quote:
             * Insert this into the section linked list
             */
 
-           sp = mh_xmalloc(sizeof(*sp));
+           NEW(sp);
            memset(sp, 0, sizeof(*sp));
            sp->value = valptr;
            sp->index = index;
@@ -3665,7 +3665,7 @@ content_charset (CT ct) {
 
     ret_charset = get_param(ct->c_ctinfo.ci_first_pm, "charset", '?', 0);
 
-    return ret_charset ? ret_charset : getcpy ("US-ASCII");
+    return ret_charset ? ret_charset : mh_xstrdup("US-ASCII");
 }
 
 
@@ -4082,10 +4082,10 @@ normal_param(PM pm, char *output, size_t len, size_t valuelen,
 PM
 add_param(PM *first, PM *last, char *name, char *value, int nocopy)
 {
-    PM pm = mh_xmalloc(sizeof(*pm));
+    PM pm;
 
+    NEW(pm);
     memset(pm, 0, sizeof(*pm));
-
     pm->pm_name = nocopy ? name : getcpy(name);
     pm->pm_value = nocopy ? value : getcpy(value);