From b87d04af8c0394cf990e37082e0d4f83e2082df1 Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 28 Aug 2025 23:27:31 +0200 Subject: [PATCH] Bugfix: grpc supress incorrect warning (#8669) new_p is a local addr but is owned now by slice_ thus the life time does not end at the end of the function Co-authored-by: Wouter van Oortmerssen --- include/flatbuffers/grpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flatbuffers/grpc.h b/include/flatbuffers/grpc.h index 7472c31d4..500df8467 100644 --- a/include/flatbuffers/grpc.h +++ b/include/flatbuffers/grpc.h @@ -121,7 +121,7 @@ class SliceAllocator : public Allocator { memcpy_downward(old_p, old_size, new_p, new_size, in_use_back, in_use_front); slice_ = new_slice; - return new_p; + return const_cast(slice_.begin()); } private: