HF hp;
/* allocate header field structure */
- hp = mh_xmalloc (sizeof(*hp));
+ NEW(hp);
/* link data into header structure */
hp->name = name;
}
if (pp == NULL) {
- pp = mh_xmalloc(sizeof(*pp));
- memset(pp, 0, sizeof(*pp));
+ NEW0(pp);
pp->name = nameptr;
pp->next = phead;
phead = pp;
* Insert this into the section linked list
*/
- sp = mh_xmalloc(sizeof(*sp));
- memset(sp, 0, sizeof(*sp));
+ NEW0(sp);
sp->value = valptr;
sp->index = index;
sp->len = len;
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");
}
PM
add_param(PM *first, PM *last, char *name, char *value, int nocopy)
{
- PM pm = mh_xmalloc(sizeof(*pm));
-
- memset(pm, 0, sizeof(*pm));
+ PM pm;
+ NEW0(pm);
pm->pm_name = nocopy ? name : getcpy(name);
pm->pm_value = nocopy ? value : getcpy(value);