diff --git a/services/hilogd/log_persister.cpp b/services/hilogd/log_persister.cpp index 4831bfac0d3ab96cdb16d4af309c154708b29cdc..93929f6c42943776845d7fc059ff0dfcecb9bcdd 100644 --- a/services/hilogd/log_persister.cpp +++ b/services/hilogd/log_persister.cpp @@ -59,6 +59,7 @@ LogPersister::LogPersister(uint32_t id, string path, uint32_t fileSize, uint16_t hilogBuffer = &_buffer; compressor = nullptr; buffer = nullptr; + compressBuffer = nullptr; plainLogSize = 0; } diff --git a/services/hilogd/log_persister_rotator.cpp b/services/hilogd/log_persister_rotator.cpp index 407172fc14f84f108cbc6cba8b9b03454474690c..1119300460efe1088b59d92ede7414cbee118be7 100644 --- a/services/hilogd/log_persister_rotator.cpp +++ b/services/hilogd/log_persister_rotator.cpp @@ -37,6 +37,7 @@ LogPersisterRotator::LogPersisterRotator(string path, uint32_t fileSize, uint32_ { index = -1; needRotate = true; + memset_s(&info, sizeof(info), 0, sizeof(info)); } LogPersisterRotator::~LogPersisterRotator()