malloc ret check fix