mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 17:17:06 +02:00
CLEANUP: Re-apply xalloc_size.cocci (2)
This reapplies the xalloc_size.cocci patch across the whole `src/` tree. see16cc16dd82
see63ee0e4c01
This commit is contained in:
parent
d649b57519
commit
9fb57e8c17
@ -726,7 +726,7 @@ struct rand_off {
|
|||||||
static struct rand_off *ncb_generate_rand_off(const struct ncbuf *buf)
|
static struct rand_off *ncb_generate_rand_off(const struct ncbuf *buf)
|
||||||
{
|
{
|
||||||
struct rand_off *roff;
|
struct rand_off *roff;
|
||||||
roff = calloc(1, sizeof(struct rand_off));
|
roff = calloc(1, sizeof(*roff));
|
||||||
BUG_ON(!roff);
|
BUG_ON(!roff);
|
||||||
|
|
||||||
roff->off = rand() % (ncb_size(buf));
|
roff->off = rand() % (ncb_size(buf));
|
||||||
|
@ -703,7 +703,7 @@ static int quic_alloc_dghdlrs(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
quic_dghdlrs = calloc(global.nbthread, sizeof(struct quic_dghdlr));
|
quic_dghdlrs = calloc(global.nbthread, sizeof(*quic_dghdlrs));
|
||||||
if (!quic_dghdlrs) {
|
if (!quic_dghdlrs) {
|
||||||
ha_alert("Failed to allocate the quic datagram handlers.\n");
|
ha_alert("Failed to allocate the quic datagram handlers.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -466,7 +466,8 @@ static int quic_alloc_accept_queues(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
quic_accept_queues = calloc(global.nbthread, sizeof(struct quic_accept_queue));
|
quic_accept_queues = calloc(global.nbthread,
|
||||||
|
sizeof(*quic_accept_queues));
|
||||||
if (!quic_accept_queues) {
|
if (!quic_accept_queues) {
|
||||||
ha_alert("Failed to allocate the quic accept queues.\n");
|
ha_alert("Failed to allocate the quic accept queues.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user