diff options
| author | 2025-09-12 19:29:17 +0330 | |
|---|---|---|
| committer | 2025-09-12 19:29:17 +0330 | |
| commit | cad89335a2d03921a0f349673114e0f69adc54d4 (patch) | |
| tree | 570e84d433abe4b91254f9d5fa15e94b3baa065f /packet_storage.c | |
| parent | starting commit (diff) | |
bug fixes
Diffstat (limited to 'packet_storage.c')
| -rw-r--r-- | packet_storage.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } } |
