Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Favre-Felix <n.favrefelix@gmail.com>2010-12-03 11:44:52 +0300
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2010-12-03 11:44:52 +0300
commit18a2d36b327158b3eca3a4486f4dfb5d0f467740 (patch)
tree17990083511bf68875a508c69856e0354e601b8a
parent449ec8a0998ae4a22f73e55a2b05321a2e71d058 (diff)
Added extra check on free.
-rw-r--r--library.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/library.c b/library.c
index 8b5e80df..b1591ff0 100644
--- a/library.c
+++ b/library.c
@@ -793,7 +793,9 @@ PHPAPI int redis_sock_server_open(RedisSock *redis_sock, int force_connect TSRML
*/
PHPAPI int redis_sock_disconnect(RedisSock *redis_sock TSRMLS_DC)
{
- int res = 0;
+ if (redis_sock == NULL) {
+ return 1;
+ }
if (redis_sock->stream != NULL) {
redis_sock_write(redis_sock, "QUIT", sizeof("QUIT") - 1 TSRMLS_CC);
@@ -804,10 +806,10 @@ PHPAPI int redis_sock_disconnect(RedisSock *redis_sock TSRMLS_DC)
}
redis_sock->stream = NULL;
- res = 1;
+ return 1;
}
- return res;
+ return 0;
}
/**