Skip to content

Memory leak in face of exceptions #118

Description

@ColinH

The constructor often does a two-step initialisation, an allocate() followed by a construct(). If the construct() throws then the previously allocated memory will leak...

        AllocatorType<object_t> alloc;
        object = alloc.allocate(1);
        alloc.construct(object, value);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions