custom request body handling firing the rfc1867 handler after the
environment has been hashed might create a memory leak by calling
array_init() twice on PG(http_globals)[TRACK_VARS_FILES]
zend_hash_init(uploaded_files, 8, NULL, free_filename, 0);
SG(rfc1867_uploaded_files) = uploaded_files;
- array_init(&PG(http_globals)[TRACK_VARS_FILES]);
+ if (Z_TYPE(PG(http_globals)[TRACK_VARS_FILES]) != IS_ARRAY) {
+ /* php_auto_globals_create_files() might have already done that */
+ array_init(&PG(http_globals)[TRACK_VARS_FILES]);
+ }
zend_llist_init(&header, sizeof(mime_header_entry), (llist_dtor_func_t) php_free_hdr_entry, 0);