X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/21d1fd096d82870eb175efbf3ee44498e47ede58..b0aa8cdb1c264e42d4931ca24968689c73381278:/uip/mhfixmsg.c diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 372dbb9c..0c5c2cef 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -819,9 +819,7 @@ replace_boundary (CT ct, char *file, char *boundary) { fprintf (fpout, "%s:%s%s\n", np, new_ctline, new_params ? new_params : ""); free(new_ctline); - if (new_params) { - free(new_params); - } + mh_xfree(new_params); } free (vp); @@ -2246,12 +2244,10 @@ strip_crs (CT ct, int *message_mods) { status = NOTOK; } else { /* Replace the decoded file with the converted one. */ - if (ct->c_cefile.ce_file) { - if (ct->c_cefile.ce_unlink) { - (void) m_unlink (ct->c_cefile.ce_file); - } - free (ct->c_cefile.ce_file); - } + if (ct->c_cefile.ce_file && ct->c_cefile.ce_unlink) + (void) m_unlink (ct->c_cefile.ce_file); + + mh_xfree(ct->c_cefile.ce_file); ct->c_cefile.ce_file = stripped_content_file; ct->c_cefile.ce_unlink = 1; @@ -2530,7 +2526,7 @@ fix_filename_param (char *name, char *value, PM *first_pm, PM *last_pm) { int fixed = 0; if (((value_len = strlen (value)) > 0) && - strncmp (value, "=?", 2) == 0 && + HasPrefix(value, "=?") && strncmp (&value[value_len - 2], "?=", 2) == 0) { /* Looks like an RFC 2047 encoded parameter. */ char decoded[PATH_MAX + 1]; @@ -2602,8 +2598,8 @@ fix_filename_encoding (CT ct) { const char *const new_params = concat (params, "\n", NULL); replace_substring (&hf->value, semicolon_loc, new_params); - free ((char *) new_params); - free ((char *) params); + free((void *)new_params); /* Cast away const. Sigh. */ + free((void *)params); } else { advise (NULL, "did not find semicolon in %s:%s\n", hf->name, hf->value);