Skip to content

Raw pointer return from RedisConnection::subscriber() risks memory leak #87

Description

@bigsamich

Description

In RedisConnection.hpp:558-567, subscriber() returns a raw owning pointer:

swr::Subscriber* subscriber()  // caller must delete

If the caller forgets to delete or an exception occurs between allocation and deletion, this leaks memory.

Severity

Medium

Suggested Fix

Return std::unique_ptr<swr::Subscriber> instead of a raw pointer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions