explicitly close the streams when doing recursive copy

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2019-01-07 15:23:05 +01:00 committed by Daniel Kesselberg
parent a0d48c568d
commit d0dc07ed75
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 4 additions and 1 deletions

View File

@ -470,7 +470,10 @@ class OC_Util {
closedir($dir);
return;
}
stream_copy_to_stream($sourceStream, $child->fopen('w'));
$targetStream = $child->fopen('w');
stream_copy_to_stream($sourceStream, $targetStream);
fclose($targetStream);
fclose($sourceStream);
}
}
}