Skip to content

Commit 23836d8

Browse files
Merge pull request #8 from kosmas-valianos/calloc
Use calloc() when allocating tlv_array so that *tlvs is set to NULL
2 parents 8adea2b + b318c0f commit 23836d8

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)