Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possinle double close of the socket #2

Open
erik-nc opened this issue Dec 11, 2015 · 0 comments
Open

Possinle double close of the socket #2

erik-nc opened this issue Dec 11, 2015 · 0 comments

Comments

@erik-nc
Copy link

erik-nc commented Dec 11, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant