mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
[Coverity] Fix leaking stream reader in error case
This commit is contained in:
@@ -953,7 +953,10 @@ ReplayStatus WrappedID3D11Device::ReadLogInitialisation(RDCFile *rdc, bool store
|
||||
StreamReader *reader = rdc->ReadSection(sectionIdx);
|
||||
|
||||
if(reader->IsErrored())
|
||||
{
|
||||
delete reader;
|
||||
return ReplayStatus::FileIOFailed;
|
||||
}
|
||||
|
||||
ReadSerialiser ser(reader, Ownership::Stream);
|
||||
|
||||
|
||||
@@ -2398,7 +2398,10 @@ ReplayStatus WrappedID3D12Device::ReadLogInitialisation(RDCFile *rdc, bool store
|
||||
StreamReader *reader = rdc->ReadSection(sectionIdx);
|
||||
|
||||
if(reader->IsErrored())
|
||||
{
|
||||
delete reader;
|
||||
return ReplayStatus::FileIOFailed;
|
||||
}
|
||||
|
||||
ReadSerialiser ser(reader, Ownership::Stream);
|
||||
|
||||
|
||||
@@ -3078,7 +3078,10 @@ ReplayStatus WrappedOpenGL::ReadLogInitialisation(RDCFile *rdc, bool storeStruct
|
||||
StreamReader *reader = rdc->ReadSection(sectionIdx);
|
||||
|
||||
if(reader->IsErrored())
|
||||
{
|
||||
delete reader;
|
||||
return ReplayStatus::FileIOFailed;
|
||||
}
|
||||
|
||||
ReadSerialiser ser(reader, Ownership::Stream);
|
||||
|
||||
|
||||
@@ -1440,7 +1440,10 @@ ReplayStatus WrappedVulkan::ReadLogInitialisation(RDCFile *rdc, bool storeStruct
|
||||
StreamReader *reader = rdc->ReadSection(sectionIdx);
|
||||
|
||||
if(reader->IsErrored())
|
||||
{
|
||||
delete reader;
|
||||
return ReplayStatus::FileIOFailed;
|
||||
}
|
||||
|
||||
ReadSerialiser ser(reader, Ownership::Stream);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user