summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/cpp/actors/interconnect/outgoing_stream.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/cpp/actors/interconnect/outgoing_stream.h b/library/cpp/actors/interconnect/outgoing_stream.h
index 980bd401f09..304fa925a8a 100644
--- a/library/cpp/actors/interconnect/outgoing_stream.h
+++ b/library/cpp/actors/interconnect/outgoing_stream.h
@@ -67,7 +67,10 @@ namespace NInterconnect {
}
TMutableContiguousSpan AcquireSpanForWriting(size_t maxLen) {
- if (maxLen && AppendOffset == BufferSize) { // we have no free buffer, allocate one
+ if (!maxLen) {
+ return {nullptr, 0};
+ }
+ if (AppendOffset == BufferSize) { // we have no free buffer, allocate one
Buffers.emplace_back(static_cast<TBuffer*>(malloc(sizeof(TBuffer))));
AppendBuffer = Buffers.back().get();
Y_ABORT_UNLESS(AppendBuffer);