mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-09 05:41:31 +00:00
Fix memory leak importing zip.xml files
This commit is contained in:
1 file changed
+4
-5
@@ -955,12 +955,11 @@ ReplayStatus importXMLZ(const char *filename, StreamReader &reader, RDCFile *rdc
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t len = reader.GetSize();
|
||||
char *buf = new char[(size_t)len + 1];
|
||||
reader.Read(buf, (size_t)len);
|
||||
buf[len] = 0;
|
||||
rdcstr buf;
|
||||
buf.resize((size_t)reader.GetSize());
|
||||
reader.Read(buf.data(), buf.size());
|
||||
|
||||
return XML2Structured(buf, thumb, extThumb, structData.buffers, rdc, structData.version,
|
||||
return XML2Structured(buf.c_str(), thumb, extThumb, structData.buffers, rdc, structData.version,
|
||||
structData.chunks, progress);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user