From cad89335a2d03921a0f349673114e0f69adc54d4 Mon Sep 17 00:00:00 2001 From: moon Date: Fri, 12 Sep 2025 19:29:17 +0330 Subject: bug fixes --- packet_storage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packet_storage.c') diff --git a/packet_storage.c b/packet_storage.c index e618490..8dd0b16 100644 --- a/packet_storage.c +++ b/packet_storage.c @@ -103,12 +103,13 @@ struct data_packet_entry* get_data_packet(hash _hash) { if (packet) { uint64_t add_idx = set_data_packet(packet); - if (add_idx != minus_one) { + free(packet); return &packet_storage[ add_idx ]; } else { - static struct data_packet_entry temp_entry; + __thread static struct data_packet_entry temp_entry; temp_entry.packet = *packet; + free(packet); return &temp_entry; } } -- cgit v1.2.3