From 49108880d2ada949caab6d64ec1eb0c81c1b67d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Thu, 11 May 2023 17:53:19 +0200 Subject: [PATCH] Add fclose on opened resources MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/encryption/lib/Command/DropLegacyFileKey.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/encryption/lib/Command/DropLegacyFileKey.php b/apps/encryption/lib/Command/DropLegacyFileKey.php index acfb7c334ee..f0a5f36f30f 100644 --- a/apps/encryption/lib/Command/DropLegacyFileKey.php +++ b/apps/encryption/lib/Command/DropLegacyFileKey.php @@ -147,6 +147,13 @@ class DropLegacyFileKey extends Command { } $output->writeln('Failed to migrate ' . $path . ''); $output->writeln('' . $e . '', OutputInterface::VERBOSITY_VERBOSE); + } finally { + if (is_resource($copyResource)) { + fclose($copyResource); + } + if (is_resource($sourceResource)) { + fclose($sourceResource); + } } } -- 2.39.5