From bd64ee6257df50c3b30f7a653f0ac6dfe786d6e2 Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Tue, 26 Sep 2023 10:45:56 +0200 Subject: [PATCH] tests: internal: stream_processor: fixed memory leak Signed-off-by: Leonardo Alminana --- tests/internal/stream_processor.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/internal/stream_processor.c b/tests/internal/stream_processor.c index d9886f873f0..9afda0bf545 100644 --- a/tests/internal/stream_processor.c +++ b/tests/internal/stream_processor.c @@ -512,6 +512,13 @@ static void test_window() /* We ingest the buffer every second */ for (t = 0; t < check->window_size_sec; t++) { + if (out_buf.buffer != NULL) { + flb_free(out_buf.buffer); + + out_buf.buffer = NULL; + out_buf.size = 0; + } + ret = flb_sp_do_test(sp, task, "samples", strlen("samples"), &data_buf, &out_buf);