@@ -1948,10 +1948,7 @@ PHP_METHOD(Redis, discard)
1948
1948
1949
1949
if (IS_PIPELINE (redis_sock )) {
1950
1950
ret = SUCCESS ;
1951
- if (redis_sock -> pipeline_cmd ) {
1952
- zend_string_release (redis_sock -> pipeline_cmd );
1953
- redis_sock -> pipeline_cmd = NULL ;
1954
- }
1951
+ smart_str_free (& redis_sock -> pipeline_cmd );
1955
1952
} else if (IS_MULTI (redis_sock )) {
1956
1953
ret = redis_send_discard (redis_sock );
1957
1954
}
@@ -2022,12 +2019,12 @@ PHP_METHOD(Redis, exec)
2022
2019
}
2023
2020
2024
2021
if (IS_PIPELINE (redis_sock )) {
2025
- if (redis_sock -> pipeline_cmd == NULL ) {
2022
+ if (smart_str_get_len ( & redis_sock -> pipeline_cmd ) == 0 ) {
2026
2023
/* Empty array when no command was run. */
2027
2024
array_init (& z_ret );
2028
2025
} else {
2029
- if (redis_sock_write (redis_sock , ZSTR_VAL (redis_sock -> pipeline_cmd ),
2030
- ZSTR_LEN (redis_sock -> pipeline_cmd )) < 0 ) {
2026
+ if (redis_sock_write (redis_sock , ZSTR_VAL (redis_sock -> pipeline_cmd . s ),
2027
+ ZSTR_LEN (redis_sock -> pipeline_cmd . s )) < 0 ) {
2031
2028
ZVAL_FALSE (& z_ret );
2032
2029
} else {
2033
2030
array_init (& z_ret );
@@ -2037,8 +2034,7 @@ PHP_METHOD(Redis, exec)
2037
2034
ZVAL_FALSE (& z_ret );
2038
2035
}
2039
2036
}
2040
- zend_string_release (redis_sock -> pipeline_cmd );
2041
- redis_sock -> pipeline_cmd = NULL ;
2037
+ smart_str_free (& redis_sock -> pipeline_cmd );
2042
2038
}
2043
2039
free_reply_callbacks (redis_sock );
2044
2040
REDIS_DISABLE_MODE (redis_sock , PIPELINE );
0 commit comments