Consolidate allocation / freeing of various data structures into one function.
Attach a file by drag & drop or click to upload