[ticket/15305] Close stream before throwing an exception

PHPBB3-15305
This commit is contained in:
Rubén Calvo 2017-08-23 16:42:06 +02:00
parent b311bb6411
commit 0ec50e9055

View file

@ -231,6 +231,7 @@ class local implements adapter_interface, stream_interface
if (stream_copy_to_stream($resource, $stream) === false) if (stream_copy_to_stream($resource, $stream) === false)
{ {
fclose($stream);
throw new exception('STORAGE_CANNOT_COPY_RESOURCE'); throw new exception('STORAGE_CANNOT_COPY_RESOURCE');
} }
} }