]> diplodocus.org Git - nmh/blobdiff - uip/mhlsbr.c
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / uip / mhlsbr.c
index 00dde630206a2754dcf0c8b5a602156026ed8f15..df0e24bf101ebf63a44cd49767acebf3a2e55135 100644 (file)
 #include <h/fmt_scan.h>
 #include <h/tws.h>
 #include <h/utils.h>
-#include "../sbr/m_popen.h"
+#include "sbr/m_popen.h"
 #include <setjmp.h>
 #include <sys/types.h>
+#include "sbr/terminal.h"
 
 /*
  * MAJOR BUG:
@@ -912,7 +913,7 @@ process (char *folder, char *fname, int ofilen, int ofilec)
                SIGNAL (SIGINT, SIG_IGN);
            if (mhl_action == NULL && fp != stdin && fp != NULL)
                fclose (fp);
-            mh_xfree(holder.c_text);
+            free(holder.c_text);
             holder.c_text = NULL;
            free_queue (&msghd, &msgtl);
            for (c1 = fmthd; c1; c1 = c1->c_next)
@@ -1211,8 +1212,8 @@ mcomp_format (struct mcomp *c1, struct mcomp *c2)
        }
        charstring_free (scanl);
 
-        mh_xfree(p->pq_text);
-        mh_xfree(p->pq_error);
+        free(p->pq_text);
+        free(p->pq_error);
        q = p->pq_next;
        free(p);
     }
@@ -1258,10 +1259,10 @@ free_queue (struct mcomp **head, struct mcomp **tail)
 
     for (c1 = *head; c1; c1 = c2) {
        c2 = c1->c_next;
-        mh_xfree(c1->c_name);
-        mh_xfree(c1->c_text);
-        mh_xfree(c1->c_ovtxt);
-        mh_xfree(c1->c_nfs);
+        free(c1->c_name);
+        free(c1->c_text);
+        free(c1->c_ovtxt);
+        free(c1->c_nfs);
        if (c1->c_fmt)
            fmt_free (c1->c_fmt, 0);
        free(c1);
@@ -1646,8 +1647,7 @@ mhldone (int status)
     exitstat = status;
     if (mhl_action)
        longjmp (mhlenv, DONE);
-    else
-       done (exitstat);
+    done (exitstat);
 }