]> diplodocus.org Git - nmh/blobdiff - uip/mhfixmsg.c
Replace GNUism with standard touch flag in test-scan-file.
[nmh] / uip / mhfixmsg.c
index 0cf8fe6f8aa5c7fe85c9f59469372c10e5648609..a820c638c98ea82a9486f9537b6216feac78d855 100644 (file)
@@ -551,6 +551,11 @@ main (int argc, char **argv)
                     (void) m_backup (file);
                 }
             }
+            if (outfp) {
+                /* close fp opened by the m_mktemp2() call in mhfixmsgsbr() */
+                fclose (outfp);
+                outfp = NULL;
+            }
         }
     } else {
         status = 1;
@@ -2740,22 +2745,19 @@ convert_charsets (CT ct, char *dest_charset, int *message_mods)
     switch (ct->c_type) {
     case CT_TEXT:
         if (ct->c_subtype == TEXT_PLAIN) {
+            char *const ct_charset = content_charset (ct);
+
             status = convert_charset (ct, dest_charset, message_mods);
             if (status == OK) {
                 if (verbosw) {
-                    char *ct_charset = content_charset (ct);
-
                     report (NULL, ct->c_partno, ct->c_file,
                             "convert %s to %s", ct_charset, dest_charset);
-                    free (ct_charset);
                 }
             } else {
-                char *ct_charset = content_charset (ct);
-
                 report ("iconv", ct->c_partno, ct->c_file,
                         "failed to convert %s to %s", ct_charset, dest_charset);
-                free (ct_charset);
             }
+            free (ct_charset);
         }
         break;