Unit test for malloc error