Skip to content

Possible resource leak in awaitable::operator= #456

@ddvamp

Description

@ddvamp

awaitable& operator=(awaitable&& other) noexcept
{
if (this != &other)
frame_ = std::exchange(other.frame_, nullptr);
return *this;
}

In the implementation of awaitable::operator=, if there is an awaitable_frame, it is not destroyed before a new one is assigned. Therefore, resource leak is possible. Mini example on godbolt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions