if the class does not have any data member and just has the mehod, it still has a chance of memory leak.
Yes, you can still leak memory on that type. You can leak on any type, even a type with no members. sizeof(EmptyClass)
will never equal 0. See: http://www.stroustrup.com/#sizeof-empty
From the spec:
The size of a most derived class shall be greater than zero.