Skip to content

Commit 37b2207

Browse files
committed
Clean up unreported memory leak by switching to zval_ptr_dtor
1 parent 76e83f7 commit 37b2207

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/standard/password.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ PHP_FUNCTION(password_needs_rehash)
250250
MAKE_COPY_ZVAL(option_buffer, cast_option_buffer);
251251
convert_to_long(cast_option_buffer);
252252
new_cost = Z_LVAL_P(cast_option_buffer);
253-
zval_dtor(cast_option_buffer);
253+
zval_ptr_dtor(&cast_option_buffer);
254254
} else {
255255
new_cost = Z_LVAL_PP(option_buffer);
256256
}
@@ -331,7 +331,7 @@ PHP_FUNCTION(password_hash)
331331
MAKE_COPY_ZVAL(option_buffer, cast_option_buffer);
332332
convert_to_long(cast_option_buffer);
333333
cost = Z_LVAL_P(cast_option_buffer);
334-
zval_dtor(cast_option_buffer);
334+
zval_ptr_dtor(&cast_option_buffer);
335335
} else {
336336
cost = Z_LVAL_PP(option_buffer);
337337
}
@@ -373,10 +373,10 @@ PHP_FUNCTION(password_hash)
373373
if (Z_TYPE_P(cast_option_buffer) == IS_STRING) {
374374
buffer = estrndup(Z_STRVAL_P(cast_option_buffer), Z_STRLEN_P(cast_option_buffer));
375375
buffer_len_int = Z_STRLEN_P(cast_option_buffer);
376-
zval_dtor(cast_option_buffer);
376+
zval_ptr_dtor(&cast_option_buffer);
377377
break;
378378
}
379-
zval_dtor(cast_option_buffer);
379+
zval_ptr_dtor(&cast_option_buffer);
380380
}
381381
case IS_BOOL:
382382
case IS_NULL:

0 commit comments

Comments
 (0)