8000 Fix #009, blPop leaking memory. · jrtkcoder/phpredis@87cfc26 · GitHub
[go: up one dir, main page]

Skip to content

Commit 87cfc26

Browse files
committed
Fix phpredis#9, blPop leaking memory.
1 parent f42d90b commit 87cfc26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

redis.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,7 @@ PHPAPI int generic_multiple_args_cmd(INTERNAL_FUNCTION_PARAMETERS, char *keyword
20062006
keys[j] = Z_STRVAL_PP(z_value_pp);
20072007
keys_len[j] = Z_STRLEN_PP(z_value_pp);
20082008

2009-
redis_key_prefix(redis_sock, &keys[j], &keys_len[j] TSRMLS_CC); /* add optional prefix TSRMLS_CC*/
2009+
redis_key_prefix(redis_sock, &keys[j], &keys_len[j] TSRMLS_CC); /* add optional prefix */
20102010

20112011
cmd_len += 1 + integer_length(keys_len[j]) + 2 + keys_len[j] + 2; /* $ + size + NL + string + NL */
20122012
j++;
@@ -2074,6 +2074,9 @@ PHPAPI int generic_multiple_args_cmd(INTERNAL_FUNCTION_PARAMETERS, char *keyword
20742074
efree(keys[i]);
20752075
}
20762076
}
2077+
if(has_timeout) { /* cleanup string created to contain timeout value */
2078+
efree(keys[real_argc-1]);
2079+
}
20772080

20782081
efree(keys);
20792082
efree(keys_len);

0 commit comments

Comments
 (0)
0