now will check the result of malloc