🎈 perf(pacekt and tcp_segment init): reduce memset
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user