Skip to content

Commit b87d04a

Browse files
fliiiixaardappel
andauthored
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 <aardappel@gmail.com>
1 parent 1e6c851 commit b87d04a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/flatbuffers/grpc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class SliceAllocator : public Allocator {
121121
memcpy_downward(old_p, old_size, new_p, new_size, in_use_back,
122122
in_use_front);
123123
slice_ = new_slice;
124-
return new_p;
124+
return const_cast<uint8_t *>(slice_.begin());
125125
}
126126

127127
private:

0 commit comments

Comments
 (0)