Skip to content

Memory leak in face of exceptions #118

@ColinH

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);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions