Use a hash table and packet lists instead of a single packet buffer
Add signal handler in debug mode to test memory leak
Add the missing return value