X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c6f2d14d9c38345075629af3487c2de491584ca1..ef1ba39e8dae81091b6c3e73e72825ef6edea3c6:/uip/picksbr.c diff --git a/uip/picksbr.c b/uip/picksbr.c index 0085b7a0..6433d2d0 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -422,7 +422,7 @@ nexp3 (void) free (n); return NULL; } - n->n_patbuf = getcpy (dp); + n->n_patbuf = mh_xstrdup(dp); return n; case PROTHR: @@ -916,11 +916,12 @@ tws_special (char *ap) if ((i -= tw->tw_wday) > 0) i -= 7; } - else + else { if (*ap != '-') return NULL; - else /* -ddd days ago */ - i = atoi (ap); /* we should error check this */ + /* -ddd days ago */ + i = atoi (ap); /* we should error check this */ + } clock += (long) ((60 * 60 * 24) * i); return dlocaltime (&clock); @@ -944,8 +945,7 @@ plist switch (state = m_getfld (&gstate, name, buf, &bufsz, fp)) { case FLD: case FLDPLUS: - if (bp != NULL) - free (bp), bp = NULL; + mh_xfree(bp); bp = add (buf, NULL); while (state == FLDPLUS) { bufsz = sizeof buf; @@ -962,8 +962,7 @@ plist case FMTERR: if (state == LENERR || state == FMTERR) advise (NULL, "format error in message %d", msgnum); - if (bp != NULL) - free (bp); + mh_xfree(bp); return 0; default: @@ -980,7 +979,6 @@ plist state = n->n_after ? (twsort (tw, &n->n_tws) > 0) : (twsort (tw, &n->n_tws) < 0); - if (bp != NULL) - free (bp); + mh_xfree(bp); return state; }