Remove references to malloc