X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6c42153ad9362cc676ea66563bf400d7511b3b68..1524cb8c0b86a854149d7859d6a2503d61dbaa36:/uip/vmhsbr.c diff --git a/uip/vmhsbr.c b/uip/vmhsbr.c index 8ee1e49d..a504220a 100644 --- a/uip/vmhsbr.c +++ b/uip/vmhsbr.c @@ -16,6 +16,7 @@ #include #include +#include #include static char *types[] = { @@ -98,8 +99,7 @@ peer2rc (struct record *rc) if (read (PEERrfd, (char *) rc_head (rc), RHSIZE (rc)) != RHSIZE (rc)) return rclose (rc, "read from peer lost(1)"); if (rc->rc_len) { - if ((rc->rc_data = malloc ((unsigned) rc->rc_len + 1)) == NULL) - return rclose (rc, "malloc of %d lost", rc->rc_len + 1); + rc->rc_data = mh_xmalloc ((unsigned) rc->rc_len + 1); if (read (PEERrfd, rc->rc_data, rc->rc_len) != rc->rc_len) return rclose (rc, "read from peer lost(2)"); rc->rc_data[rc->rc_len] = 0;