[slice_buffer] Fix forward (#29658)
This commit is contained in:
parent
409db4dd0f
commit
d96edaf63c
|
|
@ -30,7 +30,7 @@ static constexpr int kNewSliceLength = 100;
|
|||
|
||||
Slice MakeSlice(size_t len) {
|
||||
GPR_ASSERT(len > 0);
|
||||
unsigned char* contents = reinterpret_cast<unsigned char*>(new char[len]);
|
||||
unsigned char* contents = static_cast<unsigned char*>(gpr_malloc(len));
|
||||
memset(contents, 'a', len);
|
||||
return Slice(grpc_slice_new(contents, len, gpr_free));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ static constexpr int kNewSliceLength = 100;
|
|||
|
||||
Slice MakeSlice(size_t len) {
|
||||
GPR_ASSERT(len > 0);
|
||||
unsigned char* contents = reinterpret_cast<unsigned char*>(new char[len]);
|
||||
unsigned char* contents = static_cast<unsigned char*>(gpr_malloc(len));
|
||||
memset(contents, 'a', len);
|
||||
return Slice(grpc_slice_new(contents, len, gpr_free));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue