Fixing Lack of Sanity checks for malloc() calls