diff options
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; } } |
