Fix delete/new[] mismatch

This commit is contained in:
Gary Talent 2017-07-01 01:31:09 -05:00
parent 54f929a883
commit ca7a1624b5

View File

@ -693,7 +693,7 @@ int FileSystemTemplate<FileStore, FS_TYPE>::insertDirectoryEntry(const char *dir
auto entry = (DirectoryEntry<typename FileStore::InodeId_t>*) &dirBuff[s.size]; auto entry = (DirectoryEntry<typename FileStore::InodeId_t>*) &dirBuff[s.size];
entry->inode = inode; entry->inode = inode;
entry->setName(fileName); entry->setName(fileName);
return write(s.inode, dirBuff, dirBuffSize, FileType::FileType_Directory); return write(s.inode, dirBuff, dirBuffSize, FileType_Directory);
} else { } else {
return 1; return 1;
} }
@ -803,7 +803,7 @@ void FileSystemTemplate<FileStore, FS_TYPE>::expand(uint64_t newSize) {
if (newSize > size()) { if (newSize > size()) {
auto newBuff = new uint8_t[newSize]; auto newBuff = new uint8_t[newSize];
ox_memcpy(newBuff, m_store, m_store->size()); ox_memcpy(newBuff, m_store, m_store->size());
delete m_store; delete[] m_store;
m_store = (FileStore*) newBuff; m_store = (FileStore*) newBuff;
resize(newSize); resize(newSize);
} }