Patch from Olly Betts <olly@survex.com>: Issue #428

Add additional checks on memory allocation failures