Should the deallocate function be called when an error occurs in the STL allocator allocate?

  allocator, c++, stl
            try
            {
                node = allocator.allocate(LIST_BASIC_UNIT);
            }
            catch (...)
            {
                allocator.deallocate(node);
                throw;
            }

Should I call deallocator when an exception occurs in the STL allocator allocate?

Source: Windows Questions C++

LEAVE A COMMENT