X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fap.c;h=041abf1496044ac85a4fe21ff22dc76fd4722107;hb=d4c34b4439a9dbd89664de460ed37ecddc260fb1;hp=46c3ff5541fcd9d00253ffb9c001193b236cf4a0;hpb=72795bfcbe9f7fee8927b1a4942c0230b0f857a8;p=mmh diff --git a/uip/ap.c b/uip/ap.c index 46c3ff5..041abf1 100644 --- a/uip/ap.c +++ b/uip/ap.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -137,9 +138,7 @@ process(char *arg, int norm) (q = &pq)->pq_next = NULL; while ((cp = getname(arg))) { - if ((p = (struct pqpair *) - mh_xcalloc((size_t) 1, sizeof(*p))) == NULL) - adios(EX_OSERR, NULL, "unable to allocate pqpair memory"); + p = mh_xcalloc(1, sizeof(*p)); if ((mp = getm(cp, NULL, 0, norm, error)) == NULL) { p->pq_text = getcpy(cp); p->pq_error = getcpy(error); @@ -162,11 +161,11 @@ process(char *arg, int norm) fmt_scan(fmt, buffer, BUFSIZ, dat); fputs(buffer, stdout); - free(p->pq_text); + mh_free0(&(p->pq_text)); if (p->pq_error) - free(p->pq_error); + mh_free0(&(p->pq_error)); q = p->pq_next; - free((char *) p); + mh_free0(&p); } return status;