From 7cf6fbc6ee68c2a07e81e4e13687462588bb641f 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 6e9b631713c..44e983a0689 100644 --- a/tests/internal/stream_processor.c +++ b/tests/internal/stream_processor.c @@ -503,6 +503,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);