Fix out-of-bounds error when incorporating email from stdin
[mmh] / uip / mhmisc.c
index 0c8e644..eb29e83 100644 (file)
@@ -11,6 +11,8 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include <stdarg.h>
+#include <sys/stat.h>
 
 extern int debugsw;
 
@@ -119,7 +121,7 @@ losing_directory:
 
                        ep = concat("Create directory \"", file, "\"? ", NULL);
                        answer = getanswer(ep);
-                       free(ep);
+                       mh_free0(&ep);
 
                        if (!answer)
                                goto losing_directory;
@@ -235,7 +237,6 @@ flush_errors(void)
        if (errs) {
                fflush(stdout);
                fprintf(stderr, "%s", errs);
-               free(errs);
-               errs = NULL;
+               mh_free0(&errs);
        }
 }