X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/857b5bdd9941cb6b7eb77275d1a0f1c7b5c0aa3e..ef1ba39e8dae81091b6c3e73e72825ef6edea3c6:/uip/fmttest.c diff --git a/uip/fmttest.c b/uip/fmttest.c index 0b32a041..7d08438b 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -434,15 +434,13 @@ process_addresses(struct format *fmt, struct msgs_array *addrs, for (p = pq.pq_next; p; p = q) { c = fmt_findcomp("text"); if (c) { - if (c->c_text) - free(c->c_text); + mh_xfree(c->c_text); c->c_text = p->pq_text; p->pq_text = NULL; } c = fmt_findcomp("error"); if (c) { - if (c->c_text) - free(c->c_text); + mh_xfree(c->c_text); c->c_text = p->pq_error; p->pq_error = NULL; } @@ -451,10 +449,8 @@ process_addresses(struct format *fmt, struct msgs_array *addrs, fputs(charstring_buffer(buffer), stdout); mlistfree(); - 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(p); } @@ -535,8 +531,7 @@ process_messages(struct format *fmt, struct msgs_array *comps, ivector_push_back (seqnum, seq_getnum(mp, *ap)); num_unseen_seq = i; - if (dp) - free(dp); + mh_xfree(dp); } } @@ -671,8 +666,7 @@ finished: for (i = 0; i < comps->size; i += 2) { c = fmt_findcomp(comps->msgs[i]); if (c) { - if (c->c_text) - free(c->c_text); + mh_xfree(c->c_text); c->c_text = getcpy(comps->msgs[i + 1]); } } @@ -706,8 +700,7 @@ process_raw(struct format *fmt, struct msgs_array *text, charstring_t buffer, for (i = 0; i < text->size; i++) { if (c != NULL) { - if (c->c_text != NULL) - free(c->c_text); + mh_xfree(c->c_text); c->c_text = getcpy(text->msgs[i]); }