Skip to content

Commit 1260de7

Browse files
nikicremicollet
authored andcommitted
Fixed bug #78297
(cherry picked from commit 8a19fe2)
1 parent f353c77 commit 1260de7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

sapi/phpdbg/phpdbg_list.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
248248
} else {
249249
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file->filename);
250250
}
251+
return NULL;
251252
}
252253

253254
data.buf = estrndup(bufptr, len);

sapi/phpdbg/tests/bug78297.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #78297: Include unexistent file memory leak
3+
--PHPDBG--
4+
r
5+
q
6+
--FILE--
7+
<?php
8+
include "does_not_exist.php";
9+
--EXPECTF--
10+
[Successful compilation of %s]
11+
prompt>
12+
Warning: include(%s): failed to open stream: No such file or directory in %s on line %d
13+
14+
Warning: include(): Failed opening 'does_not_exist.php' for inclusion (include_path=%s) in %s on line %d
15+
[Script ended normally]
16+
prompt>

0 commit comments

Comments
 (0)