check malloc ret NULL in cpp class