Skip to content

Commit fc673f5

Browse files
Don't try and efree a non allocated variable
Addresses phpredis#638
1 parent 516e3a6 commit fc673f5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

redis.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5621,10 +5621,9 @@ PHP_REDIS_API void generic_subscribe_cmd(INTERNAL_FUNCTION_PARAMETERS, char *sub
56215621
}
56225622

56235623
if (zend_hash_index_find(Z_ARRVAL_P(z_tab), 0, (void**)&tmp) == SUCCESS) {
5624-
type_response = Z_STRVAL_PP(tmp);
5624+
type_response = Z_STRVAL_PP(tmp);
56255625
if(strcmp(type_response, sub_cmd) != 0) {
5626-
efree(tmp);
5627-
zval_dtor(z_tab);
5626+
zval_dtor(z_tab);
56285627
efree(z_tab);
56295628
RETURN_FALSE;
56305629
}

0 commit comments

Comments
 (0)