🎈 perf(pacekt and tcp_segment init): reduce memset

This commit is contained in:
yangwei
2024-07-31 00:00:44 +08:00
committed by luwenpeng
parent 0414710399
commit 49539eb253
3 changed files with 3 additions and 9 deletions

View File

@@ -490,7 +490,7 @@ uint16_t packet_get_payload_len(const struct packet *pkt)
struct packet *packet_new(uint16_t pkt_len)
{
struct packet *pkt = (struct packet *)calloc(1, sizeof(struct packet) + pkt_len);
struct packet *pkt = (struct packet *)malloc( sizeof(struct packet) + pkt_len);
if (pkt == NULL)
{
return NULL;