** least one) until we get to the actual
** text. Copy until we get to a non-space.
*/
- output = mh_xmalloc(outlen);
+ output = mh_xcalloc(outlen, sizeof(char));
q = output;
while (is_fws(*p)) {
*q++ = *p++;
}
*q = '\0';
- free(*value);
+ mh_free0(value);
*value = output;
return 0;
static void
unfold_header(char **value, int len)
{
- char *str = mh_xmalloc(len + 1);
+ char *str = mh_xcalloc(len + 1, sizeof(char));
char *p = str, *q = *value;
while (*q != '\0') {
}
*p = '\0';
- free(*value);
+ mh_free0(value);
*value = str;
}
output = add(cp, output);
column += len;
- free(cp);
- cp = NULL;
+ mh_free0(&cp);
}
/*
output = add("\n", output);
- free(*value);
+ mh_free0(value);
*value = output;
output = NULL;
out:
if (tmpbuf) {
- free(tmpbuf);
+ mh_free0(&tmpbuf);
}
if (output) {
- free(output);
+ mh_free0(&output);
}
return errflag > 0;