SimpleRedisClient icon indicating copy to clipboard operation
SimpleRedisClient copied to clipboard

Possinle double close of the socket

Open erik-nc opened this issue 10 years ago • 0 comments

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

erik-nc avatar Dec 11 '15 13:12 erik-nc