You seem to not delete this allocated memory anywhere. Use of destructor to achieve the same.