Skip to content

Commit 5465cea

Browse files
authored
Remove unused variable 'error' (#12438)
Will also get rid of the potential allocation happening in zend_is_callable_ex().
1 parent 5a0c007 commit 5465cea

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ext/pcntl/pcntl.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ PHP_FUNCTION(pcntl_signal)
600600
zend_long signo;
601601
bool restart_syscalls = 1;
602602
bool restart_syscalls_is_null = 1;
603-
char *error = NULL;
604603

605604
ZEND_PARSE_PARAMETERS_START(2, 3)
606605
Z_PARAM_LONG(signo)
@@ -654,14 +653,12 @@ PHP_FUNCTION(pcntl_signal)
654653
RETURN_TRUE;
655654
}
656655

657-
if (!zend_is_callable_ex(handle, NULL, 0, NULL, NULL, &error)) {
656+
if (!zend_is_callable_ex(handle, NULL, 0, NULL, NULL, NULL)) {
658657
PCNTL_G(last_error) = EINVAL;
659658

660659
zend_argument_type_error(2, "must be of type callable|int, %s given", zend_zval_value_name(handle));
661-
efree(error);
662660
RETURN_THROWS();
663661
}
664-
ZEND_ASSERT(!error);
665662

666663
/* Add the function name to our signal table */
667664
handle = zend_hash_index_update(&PCNTL_G(php_signal_table), signo, handle);

0 commit comments

Comments
 (0)