File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -383,9 +383,11 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
383
383
zend_module_entry * m ;
384
384
char * lc_name = zend_str_tolower_dup (
385
385
Z_STRVAL (ZEND_OP1_LITERAL (opline - 1 )), Z_STRLEN (ZEND_OP1_LITERAL (opline - 1 )));
386
+ int found = zend_hash_find (& module_registry ,
387
+ lc_name , Z_STRLEN (ZEND_OP1_LITERAL (opline - 1 )) + 1 , (void * )& m ) == SUCCESS ;
386
388
387
- if ( zend_hash_find ( & module_registry ,
388
- lc_name , Z_STRLEN ( ZEND_OP1_LITERAL ( opline - 1 )) + 1 , ( void * ) & m ) == FAILURE ) {
389
+ efree ( lc_name );
390
+ if (! found ) {
389
391
if (!PG (enable_dl )) {
390
392
break ;
391
393
} else {
@@ -405,7 +407,6 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
405
407
literal_dtor (& ZEND_OP1_LITERAL (opline ));
406
408
MAKE_NOP (opline );
407
409
}
408
- efree (lc_name );
409
410
} else if (Z_STRLEN (ZEND_OP1_LITERAL (opline )) == sizeof ("defined" )- 1 &&
410
411
!memcmp (Z_STRVAL (ZEND_OP1_LITERAL (opline )),
411
412
"defined" , sizeof ("defined" )- 1 )) {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #66334 (Memory Leak in new pass1_5.c optimizations)
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ opcache.file_update_protection=0
8
+ enable_dl=0
9
+ --SKIPIF--
10
+ <?php require_once ('skipif.inc ' ); ?>
11
+ --FILE--
12
+ <?php
13
+ if (extension_loaded ("unknown_extension " )) {
14
+ var_dump (1 );
15
+ } else {
16
+ var_dump (2 );
17
+ }
18
+ --EXPECT --
19
+ int (2 )
You can’t perform that action at this time.
0 commit comments