/* alloc srv array (it will be used for active and backup server lists in turn,
* so we ensure that the longest list will fit
*/
- be->lbprm.log.srv = calloc(MAX(be->srv_act, be->srv_bck), sizeof(struct server *));
+ be->lbprm.log.srv = calloc(MAX(be->srv_act, be->srv_bck),
+ sizeof(*be->lbprm.log.srv));
if (!be->lbprm.log.srv ) {
memprintf(&msg, "memory error when allocating server array (%d entries)",
MT_LIST_INIT(&dghdlr->dgrams);
}
- quic_cid_trees = calloc(QUIC_CID_TREES_CNT, sizeof(struct quic_cid_tree));
+ quic_cid_trees = calloc(QUIC_CID_TREES_CNT, sizeof(*quic_cid_trees));
if (!quic_cid_trees) {
ha_alert("Failed to allocate global CIDs trees.\n");
return 0;
}
}
- srv_tlv = malloc(sizeof(struct srv_pp_tlv_list));
+ srv_tlv = malloc(sizeof(*srv_tlv));
if (unlikely(!srv_tlv)) {
memprintf(err, "'%s' : failed to parse allocate TLV entry", args[*cur_arg]);
goto fail;
list_for_each_entry(srv_tlv, &src->pp_tlvs, list) {
if (srv_tlv == NULL)
break;
- new_srv_tlv = malloc(sizeof(struct srv_pp_tlv_list));
+ new_srv_tlv = malloc(sizeof(*new_srv_tlv));
if (unlikely(!new_srv_tlv)) {
break;
}
(strcmp(args[cur_arg], "EHLO") == 0 || strcmp(args[cur_arg], "HELO") == 0)) {
/* <EHLO|HELO> + space (1) + <host> + null byte (1) */
size_t len = strlen(args[cur_arg]) + 1 + strlen(args[cur_arg+1]) + 1;
- cmd = calloc(len, 1);
+ cmd = calloc(1, len);
if (cmd)
snprintf(cmd, len, "%s %s", args[cur_arg], args[cur_arg+1]);
}