checks return codes, and sanitises resource allocation.
Attach a file by drag & drop or click to upload