Check the result of malloc

Throw an exception if it should happen to fail. Yeah, I should probably
use 'new' instead of 'malloc', but I like an untyped block of data to
look like an untyped block of data.