]> granicus.if.org Git - php/commitdiff
Fixed bug #78297
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 16 Jul 2019 09:08:27 +0000 (11:08 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 16 Jul 2019 09:09:17 +0000 (11:09 +0200)
NEWS
sapi/phpdbg/phpdbg_list.c
sapi/phpdbg/tests/bug78297.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 5bd2178b5962fd47566be951427d52379bef0f27..daeb3b68664001142b2d3691f28fa57dea060f3c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2019, PHP 7.2.22
 
+- Phpdbg:
+  . Fixed bug #78297 (Include unexistent file memory leak). (Nikita)
 
 01 Aug 2019, PHP 7.2.21
 
index aab641cb5606ee1fb52fcc1eced3a044618ac018..a9b0f4b815cff365ca96e1932498fff5a5f6eecd 100644 (file)
@@ -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 (file)
index 0000000..47b13ad
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Bug #78297: Include unexistent file memory leak
+--PHPDBG--
+r
+q
+--FILE--
+<?php
+include "does_not_exist.php";
+--EXPECTF--
+[Successful compilation of %s]
+prompt> 
+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>