/* mhfree.c */
extern CT *cts;
-void freects_done (int) NORETURN;
/*
* static prototypes
if (nmh_init(argv[0], 2)) { return 1; }
- done = freects_done;
-
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
if (*cts) {
for (ctp = cts; *ctp; ++ctp) {
status += mhfixmsgsbr (ctp, maildir, &fx, outfile);
+ free_content (*ctp);
if (using_stdin) {
(void) m_unlink (file);
}
}
}
+
+ free (cts);
} else {
status = 1;
}
free (folder);
free (arguments);
- /* done is freects_done, which will clean up all of cts. */
done (status);
return NOTOK;
}
/* This will fail if the boundary spans fread() calls. NMH_BUFSIZ should
be big enough, even if it's just 1024, to make that unlikely. */
- /* free_content() will close ct->c_fp. */
+ /* free_content() will close ct->c_fp if bogus MP boundary is fixed. */
if (! ct->c_fp && (ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
advise (ct->c_file, "unable to open for reading");
return NOTOK;
status = NOTOK;
}
+ if (ct->c_fp) {
+ fclose (ct->c_fp);
+ ct->c_fp = NULL;
+ }
+
if (status == OK) {
*part_boundary = end_boundary;
} else {