8000 Fix leak in get response · jrtkcoder/phpredis@bfbdaa9 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfbdaa9

Browse files
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
1 parent f4f5959 commit bfbdaa9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,8 @@ PHP_REDIS_API void redis_string_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock
14071407
if(redis_unserialize(redis_sock, response, response_len,
14081408
return_value TSRMLS_CC) == 0)
14091409
{
1410-
RETURN_STRINGL(response, response_len);
1410+
RETVAL_STRINGL(response, response_len);
1411+
efree(response);
14111412
} else {
14121413
efree(response);
14131414
}

0 commit comments

Comments
 (0)
0