From: Thies C. Arntzen Date: Thu, 2 Dec 1999 14:37:16 +0000 (+0000) Subject: php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the... X-Git-Tag: PRE_RETURN_REF_PATCH~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b92d70aabe9b0f7c4adee6c51bb701efb2f982e5;p=php php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the caller needs to fclose() the file. (not sure if this is desired) fixed "Uninitialized memory read" when including URLs --- diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l index 0e5ad67ecc..9c1d291d1b 100644 --- a/Zend/zend-scanner.l +++ b/Zend/zend-scanner.l @@ -186,6 +186,10 @@ BEGIN_EXTERN_C() ZEND_API void zend_open_file_dtor(zend_file_handle *fh) { switch (fh->type) { + case ZEND_HANDLE_FILENAME: + fclose(fh->handle.fp); + break; + case ZEND_HANDLE_FP: fclose(fh->handle.fp); break; @@ -384,6 +388,7 @@ zend_op_array *compile_filename(zval *filename, zend_bool unique CLS_DC) } file_handle.filename = filename->value.str.val; file_handle.type = ZEND_HANDLE_FILENAME; + file_handle.opened_path = NULL; retval = zend_compile_files(1 CLS_CC, 1, &file_handle); if (file_handle.opened_path) { free(file_handle.opened_path);