diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index 36317637475..901fd0bb1cb 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -248,6 +248,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { } else { zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file->filename); } + return NULL; } data.buf = estrndup(bufptr, len); diff --git a/sapi/phpdbg/tests/bug78297.phpt b/sapi/phpdbg/tests/bug78297.phpt new file mode 100644 index 00000000000..47b13ad6054 --- /dev/null +++ b/sapi/phpdbg/tests/bug78297.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #78297: Include unexistent file memory leak +--PHPDBG-- +r +q +--FILE-- + +Warning: include(%s): failed to open stream: No such file or directory in %s on line %d + +Warning: include(): Failed opening 'does_not_exist.php' for inclusion (include_path=%s) in %s on line %d +[Script ended normally] +prompt>