mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-08 19:00:57 +00:00
CLOUD: Fix UploadFileClientHandler
A few possible memory leaks about `_contentStream` there.
This commit is contained in:
parent
46dda5fce0
commit
2c34864a06
@ -137,6 +137,12 @@ void UploadFileClientHandler::handleBlockHeaders(Client *client) {
|
||||
return;
|
||||
}
|
||||
|
||||
// remove previous stream (if there is one)
|
||||
if (_contentStream) {
|
||||
delete _contentStream;
|
||||
_contentStream = nullptr;
|
||||
}
|
||||
|
||||
// create file stream (and necessary subdirectories)
|
||||
Common::DumpFile *f = new Common::DumpFile();
|
||||
if (!f->open(originalNode->getPath(), true)) {
|
||||
@ -156,6 +162,9 @@ void UploadFileClientHandler::handleBlockContent(Client *client) {
|
||||
_contentStream->flush();
|
||||
++_uploadedFiles;
|
||||
|
||||
delete _contentStream;
|
||||
_contentStream = nullptr;
|
||||
|
||||
if (client->noMoreContent()) {
|
||||
// success - redirect back to directory listing
|
||||
HandlerUtils::setMessageHandler(
|
||||
|
Loading…
Reference in New Issue
Block a user