]> diplodocus.org Git - nmh/blobdiff - uip/ap.c
Replace `if (p) free(p)' with `mh_xfree(p)'.
[nmh] / uip / ap.c
index dff6dc4370e182ff8f6d3d1b8dc7b5448cf111c7..bfec342923a7d033fe57901b82d6cc9e8957f3a4 100644 (file)
--- a/uip/ap.c
+++ b/uip/ap.c
@@ -157,8 +157,8 @@ process (char *arg, int length)
     while ((cp = getname (arg))) {
        NEW0(p);
        if ((mp = getm (cp, NULL, 0, error, sizeof(error))) == NULL) {
-           p->pq_text = getcpy (cp);
-           p->pq_error = getcpy (error);
+           p->pq_text = mh_xstrdup(cp);
+           p->pq_error = mh_xstrdup(error);
            status++;
        }
        else {
@@ -174,15 +174,13 @@ process (char *arg, int length)
 
        cptr = fmt_findcomp ("text");
        if (cptr) {
-           if (cptr->c_text)
-               free(cptr->c_text);
+            mh_xfree(cptr->c_text);
            cptr->c_text = p->pq_text;
            p->pq_text = NULL;
        }
        cptr = fmt_findcomp ("error");
        if (cptr) {
-           if (cptr->c_text)
-               free(cptr->c_text);
+            mh_xfree(cptr->c_text);
            cptr->c_text = p->pq_error;
            p->pq_error = NULL;
        }
@@ -191,10 +189,8 @@ process (char *arg, int length)
        fputs (charstring_buffer (scanl), stdout);
        charstring_free (scanl);
 
-       if (p->pq_text)
-           free (p->pq_text);
-       if (p->pq_error)
-           free (p->pq_error);
+        mh_xfree(p->pq_text);
+        mh_xfree(p->pq_error);
        q = p->pq_next;
        free ((char *) p);
     }