Fix a warning from uninitialized variables (#17052)

Currently, when a project that includes protobuf is compiled using -Werror, the build will fail due to these variables not being initialized. This fixes this warning allowing the build to complete successfully

Closes #17052

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/17052 from guitar24t:main a0d295c222
PiperOrigin-RevId: 685735896
pull/18805/head
Robert 4 months ago committed by Copybara-Service
parent 8f6a7a2ceb
commit 42070a017d
  1. 4
      src/google/protobuf/thread_safe_arena.h

@ -76,7 +76,7 @@ class PROTOBUF_EXPORT ThreadSafeArena {
}
void ReturnArrayMemory(void* p, size_t size) {
SerialArena* arena;
SerialArena* arena = nullptr;
if (PROTOBUF_PREDICT_TRUE(GetSerialArenaFast(&arena))) {
arena->ReturnArrayMemory(p, size);
}
@ -88,7 +88,7 @@ class PROTOBUF_EXPORT ThreadSafeArena {
// have fallback function calls in tail position. This substantially improves
// code for the happy path.
PROTOBUF_NDEBUG_INLINE bool MaybeAllocateAligned(size_t n, void** out) {
SerialArena* arena;
SerialArena* arena = nullptr;
if (PROTOBUF_PREDICT_TRUE(GetSerialArenaFast(&arena))) {
return arena->MaybeAllocateAligned(n, out);
}

Loading…
Cancel
Save