]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added missing fclose in file_get_contents and file_put_contents
authorVincent Petry <pvince81@owncloud.com>
Mon, 31 Mar 2014 16:37:52 +0000 (18:37 +0200)
committerVincent Petry <pvince81@owncloud.com>
Tue, 1 Apr 2014 08:08:16 +0000 (10:08 +0200)
lib/private/files/storage/common.php

index 480cf6b5c77bc8e60e70efe406f87a7a9ed5c9cd..0ce447a5a4871bfda81fca7601d96e4c85f0a694 100644 (file)
@@ -119,13 +119,16 @@ abstract class Common implements \OC\Files\Storage\Storage {
                        return false;
                }
                $data = stream_get_contents($handle);
+               fclose($handle);
                return $data;
        }
 
        public function file_put_contents($path, $data) {
                $handle = $this->fopen($path, "w");
                $this->removeCachedFile($path);
-               return fwrite($handle, $data);
+               $count = fwrite($handle, $data);
+               fclose($handle);
+               return $count;
        }
 
        public function rename($path1, $path2) {