From 48a12f6f51637c41b51b7417dffc36c29979348b Mon Sep 17 00:00:00 2001
From: Costa Tsaousis <costa@netdata.cloud>
Date: Sat, 8 Mar 2025 16:22:44 +0000
Subject: [PATCH] fix memory corruption in streaming (#19805)

---
 src/streaming/stream-receiver.c | 1 +
 src/streaming/stream-sender.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/streaming/stream-receiver.c b/src/streaming/stream-receiver.c
index 36668912d3..450e26d223 100644
--- a/src/streaming/stream-receiver.c
+++ b/src/streaming/stream-receiver.c
@@ -1055,6 +1055,7 @@ void stream_receiver_replication_check_from_poll(struct stream_thread *sth, usec
                    __atomic_load_n(&host->stream.rcv.status.replication.counter_in, __ATOMIC_RELAXED));
 
             stream_receiver_remove(sth, rpt, STREAM_HANDSHAKE_DISCONNECT_REPLICATION_STALLED);
+            continue;
         }
 
         rpt->replication.last_checked_ut = rpt->replication.last_progress_ut;
diff --git a/src/streaming/stream-sender.c b/src/streaming/stream-sender.c
index e54d44bb16..08dd34085f 100644
--- a/src/streaming/stream-sender.c
+++ b/src/streaming/stream-sender.c
@@ -630,6 +630,7 @@ void stream_sender_replication_check_from_poll(struct stream_thread *sth, usec_t
                    __atomic_load_n(&host->stream.snd.status.replication.counter_out, __ATOMIC_RELAXED));
 
             stream_sender_move_running_to_connector_or_remove(sth, s, STREAM_HANDSHAKE_DISCONNECT_REPLICATION_STALLED, 0, true);
+            continue;
         }
 
         s->replication.last_checked_ut = s->replication.last_progress_ut;