Listing 2 This function allocates enough storage for the data. The calling program can then destroy the item whose address was passed.

add_item_to_linked_list(void * pointer_to_item,
   int size_of_item)
   {
   struct s_link *new_link;
   new_link = malloc(sizeof(struct s_link));
   new_link->pointer_to_data = malloc(size_of_item);
   memcpy(new_link->pointer_to_data, pointer_to_item,
         size_of_item);
   ...
   }

/* End of File */