Skip to content

Commit 6851bdd

Browse files
laruencerlerdorf
authored andcommitted
Fixed memory leak
1 parent cbcbece commit 6851bdd

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

php_memcached.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,16 +2548,9 @@ uint32_t *s_zval_to_uint32_array (zval *input, size_t *num_elements)
25482548

25492549
if (Z_TYPE_P(pzval) == IS_LONG) {
25502550
value = Z_LVAL_P(pzval);
2551-
}
2552-
else {
2553-
zval *tmp_zval, *tmp_pzval;
2554-
tmp_zval = pzval;
2555-
zval_copy_ctor(tmp_zval);
2556-
tmp_pzval = tmp_zval;
2557-
convert_to_long(tmp_pzval);
2558-
2559-
value = (Z_LVAL_P(tmp_pzval) > 0) ? Z_LVAL_P(tmp_pzval) : 0;
2560-
zval_dtor(tmp_pzval);
2551+
} else {
2552+
value = zval_get_long(pzval);
2553+
value = value > 0? value : 0;
25612554
}
25622555

25632556
if (value < 0) {

0 commit comments

Comments
 (0)