Initialize the insert_at member of newly created pkt_info_t items. Removes potential for segfault noted in #126.
Replace calls of wmem_alloc() with wmem_new0(). The 0 in the name is because this routine initializes the allocated memory with null bytes, so if members of data structures are added in the future but aren't fully initialized, they don't potentially dangle pointers. (This has the potential to reduce boilerplate for manually initializing structure members to zero, but that is left as-is for now to minimize patch size.)
The use of wmem_new0() also handles casting the returned memory to the right data type, although this is just a bonus here.
Initialize the
insert_at
member of newly createdpkt_info_t
items. Removes potential for segfault noted in #126.Replace calls of
wmem_alloc()
withwmem_new0()
. The0
in the name is because this routine initializes the allocated memory with null bytes, so if members of data structures are added in the future but aren't fully initialized, they don't potentially dangle pointers. (This has the potential to reduce boilerplate for manually initializing structure members to zero, but that is left as-is for now to minimize patch size.)The use of
wmem_new0()
also handles casting the returned memory to the right data type, although this is just a bonus here.Closes #126