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:
authormichael-grunder <michael.grunder@gmail.com>2015-12-21 22:08:28 +0300
committermichael-grunder <michael.grunder@gmail.com>2015-12-21 22:08:28 +0300
commitbfbdaa9c0a7757a6142becc88cbf05e9ba785bac (patch)
tree9d415b9bd14dc377ac0efdd27c64c76e47ac6329
parentf4f59595f02ee5871ca3aae5ca58323e17e8eb3d (diff)
Fix leak in get response
PHP 7 has done away with the third argument to RETURN_STRINGL (where one could decide if the string was to be duplicated or not) meaning that we now need to free our response as RETVAL_STRINGL will duplicate the string. I'm not sure what the proper solution is for this in php7
-rw-r--r--library.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/library.c b/library.c
index d1874a11..60bf1062 100644
--- a/library.c
+++ b/library.c
@@ -1407,7 +1407,8 @@ PHP_REDIS_API void redis_string_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock
if(redis_unserialize(redis_sock, response, response_len,
return_value TSRMLS_CC) == 0)
{
- RETURN_STRINGL(response, response_len);
+ RETVAL_STRINGL(response, response_len);
+ efree(response);
} else {
efree(response);
}