Fix buffer not alloced bug

This commit is contained in:
zhanglistar 2022-02-17 16:33:35 +08:00
parent 7868153098
commit cd0f7d5b16

View File

@ -309,7 +309,7 @@ static int bufferFromFile(Poco::Logger * log, const std::string & path, nuraft::
::close(fd); ::close(fd);
return errno; return errno;
} }
data_out->alloc(file_size); data_out = nuraft::buffer::alloc(file_size);
data_out->put_raw(chunk, file_size); data_out->put_raw(chunk, file_size);
::munmap(chunk, file_size); ::munmap(chunk, file_size);
::close(fd); ::close(fd);