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 {
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;
}
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);
+ free(p);
}
return status;