Skip to content

Commit b318c0f

Browse files
Use calloc() when allocating tlv_array so that *tlvs is set to NULL
1 parent 8adea2b commit b318c0f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/proxy_protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ static int32_t pp2_parse_hdr(uint8_t *pkt, uint32_t pktlen, pp_info_t *pp_info)
682682
/* Any TLV vector must be at least 3 bytes */
683683
if (tlv_vectors_len > 3)
684684
{
685-
pp_info->tlv_array = malloc(sizeof(*pp_info->tlv_array));
685+
pp_info->tlv_array = calloc(1, sizeof(*pp_info->tlv_array));
686686
}
687687
while (tlv_vectors_len > 3)
688688
{

0 commit comments

Comments
 (0)