Add fclose on opened resources

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-05-11 17:53:19 +02:00
parent a92028f5cd
commit 49108880d2
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -147,6 +147,13 @@ class DropLegacyFileKey extends Command {
}
$output->writeln('<error>Failed to migrate ' . $path . '</error>');
$output->writeln('<error>' . $e . '</error>', OutputInterface::VERBOSITY_VERBOSE);
} finally {
if (is_resource($copyResource)) {
fclose($copyResource);
}
if (is_resource($sourceResource)) {
fclose($sourceResource);
}
}
}