id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 43255,WP_Image_Editor::make_image leaves an output buffer open on failure,gnif,kirasong,"WP_Image_Editor::make_image is failing to clean up on failure leaving an output buffer open. If the call to fopen fails the function returns without calling 'ob_end_clean()' {{{ protected function make_image( $filename, $function, $arguments ) { if ( $stream = wp_is_stream( $filename ) ) { ob_start(); } else { // The directory containing the original file may no longer exist when using a replication plugin. wp_mkdir_p( dirname( $filename ) ); } $result = call_user_func_array( $function, $arguments ); if ( $result && $stream ) { $contents = ob_get_contents(); $fp = fopen( $filename, 'w' ); if ( ! $fp ) { ob_end_clean(); // <-- This is needed return false; } fwrite( $fp, $contents ); fclose( $fp ); } if ( $stream ) { ob_end_clean(); } return $result; } }}} ",defect (bug),closed,normal,4.9.9,Media,3.5,critical,fixed,has-patch fixed-major fixed-5.0,,