From b577d3486179d449a47aefbef8c8f6049385e254 Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Wed, 8 Feb 2017 14:33:48 +0000 Subject: [PATCH] MDL-57801 core_filestorage: Delete temp file if disk space runs out --- lib/filestorage/file_storage.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/filestorage/file_storage.php b/lib/filestorage/file_storage.php index b5d6fdd72fb..965ace2820c 100644 --- a/lib/filestorage/file_storage.php +++ b/lib/filestorage/file_storage.php @@ -2001,6 +2001,7 @@ class file_storage { @unlink($hashfile.'.tmp'); if (!copy($pathname, $hashfile.'.tmp')) { // Borked permissions or out of disk space. + @unlink($hashfile.'.tmp'); ignore_user_abort($prev); throw new file_exception('storedfilecannotcreatefile'); }