Skip to content

Possinle double close of the socket #2

@erik-nc

Description

@erik-nc

Hi,

I've noticed that the FD of the redis connection socket might be closed twice, if redis_close() is called explicitly and afterwards the client object gets out of scope causing a call to the destructor.
Especially in a multi-threaded context an application might already opened a new FD with the very same number. I suggest setting the FD to 0 in redis_close() to avoid the double close. Better would be using -1 to denote an uninitialized or closed FD.

Best regards
Erik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions