Small change.
Alloc packets with calloc.
Refactoring and replace malloc with calloc.