CLEANUP: quic: use pool_zalloc() instead of pool_alloc+memset

Two places used to alloc then zero the area, let's have the allocator do it.
This commit is contained in:
Willy Tarreau 2021-03-22 21:13:05 +01:00
parent 6922e550eb
commit e44989369d

View File

@ -2322,9 +2322,8 @@ struct quic_conn *new_quic_conn(uint32_t version)
{
struct quic_conn *quic_conn;
quic_conn = pool_alloc(pool_head_quic_conn);
quic_conn = pool_zalloc(pool_head_quic_conn);
if (quic_conn) {
memset(quic_conn, 0, sizeof *quic_conn);
quic_conn->version = version;
}
@ -4217,11 +4216,10 @@ static ssize_t quic_dgram_read(char *buf, size_t len, void *owner,
int ret;
struct quic_rx_packet *pkt;
pkt = pool_alloc(pool_head_quic_rx_packet);
pkt = pool_zalloc(pool_head_quic_rx_packet);
if (!pkt)
goto err;
memset(pkt, 0, sizeof(*pkt));
quic_rx_packet_refinc(pkt);
ret = func(&pos, end, pkt, &dgram_ctx, saddr);
if (ret == -1) {