From 321d649b519bae91c90cdebfb90a6655d9c301cd Mon Sep 17 00:00:00 2001 From: bcsgh <33939446+bcsgh@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:39:50 -0800 Subject: [PATCH] Avoid a 'may be used uninitialized' warning when built with '-c opt' (that could result in a non-null garbage pointer). --- src/google/protobuf/arena.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index bc162e9844596..170d004c96b1b 100644 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -193,7 +193,7 @@ SizedPtr SerialArena::Free(Deallocator deallocator) { PROTOBUF_NOINLINE void* SerialArena::AllocateAlignedFallback(size_t n) { AllocateNewBlock(n); - void* ret; + void* ret = nullptr; bool res = MaybeAllocateAligned(n, &ret); ABSL_DCHECK(res); return ret;