checks for malloc failure
catches malloc error and raises a RuntimeError
Merge remote branch 'ddale/malloc-failure'