1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

fix(asan): fix ASAN warnings spoted

This commit is contained in:
drrtuy
2025-06-12 17:23:46 +00:00
parent 576f4fb81c
commit c4d60f66c4
3 changed files with 8 additions and 8 deletions

View File

@ -1402,12 +1402,12 @@ void VSS::load(string filename)
*/
size_t readSize = header.entries * sizeof(entry);
char* readBuf = new char[readSize];
std::unique_ptr<char[]> readBuf(new char[readSize]);
size_t progress = 0;
int err;
while (progress < readSize)
{
err = in->read(readBuf + progress, readSize - progress);
err = in->read(readBuf.get() + progress, readSize - progress);
if (err < 0)
{
log_errno("VBBM::load()");
@ -1421,7 +1421,7 @@ void VSS::load(string filename)
progress += err;
}
VSSEntry* loadedEntries = (VSSEntry*)readBuf;
VSSEntry* loadedEntries = reinterpret_cast<VSSEntry*>(readBuf.get());
for (i = 0; i < header.entries; i++)
insert(loadedEntries[i].lbid, loadedEntries[i].verID, loadedEntries[i].vbFlag, loadedEntries[i].locked,
true);