diff --git a/hio/lib/dns.c b/hio/lib/dns.c index 4c91dbf..5530f11 100644 --- a/hio/lib/dns.c +++ b/hio/lib/dns.c @@ -765,7 +765,7 @@ hio_dns_msg_t* hio_dns_make_msg (hio_t* hio, hio_dns_bhdr_t* bhdr, hio_dns_bqr_t msgbufsz = HIO_SIZEOF(*msg) + HIO_ALIGN_POW2(pktlen, HIO_SIZEOF_VOID_P) + xtnsize; /* TODO: msg buffer reuse */ - msg = hio_callocmem(hio, msgbufsz); + msg = (hio_dns_msg_t*)hio_callocmem(hio, msgbufsz); if (HIO_UNLIKELY(!msg)) return HIO_NULL; msg->msglen = msgbufsz; /* record the instance size */ diff --git a/hio/lib/http-svr.c b/hio/lib/http-svr.c index 423fd72..38cfb6b 100644 --- a/hio/lib/http-svr.c +++ b/hio/lib/http-svr.c @@ -357,7 +357,7 @@ hio_svc_htts_t* hio_svc_htts_start (hio_t* hio, hio_dev_sck_bind_t* sck_bind, hi info.m.on_connect = listener_on_connect; info.m.on_disconnect = listener_on_disconnect; htts->lsck = hio_dev_sck_make(hio, HIO_SIZEOF(*cli), &info.m); - if (!htts->lsck) goto oops; + if (HIO_UNLIKELY(!htts->lsck)) goto oops; /* the name 'cli' for the listening socket is awkward. * the listening socket will use the htts and sck fields for tracking only.