From b6838536fcd0f4361d3907e95f3247b1f1281a62 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 6 Nov 2026 19:25:45 +0100 Subject: To silence leak checkers, properly deinit fullscrape writers when zlib is used, in case opentracker stops mid-creation --- src/ot_fullscrape.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/ot_fullscrape.c') diff --git a/src/ot_fullscrape.c b/src/ot_fullscrape.c index ef39a17..52ec480 100644 --- a/src/ot_fullscrape.c +++ b/src/ot_fullscrape.c @@ -188,8 +188,10 @@ static void fullscrape_make(int taskid, ot_tasktype mode) { mutex_bucket_unlock(bucket, 0); /* Parent thread died? */ - if (!g_opentracker_running) + if (!g_opentracker_running) { + free(iovector.iov_base); return; + } } if ((mode & TASK_TASK_MASK) == TASK_FULLSCRAPE) @@ -250,6 +252,7 @@ static void fullscrape_make_gzip(int taskid, ot_tasktype mode) { if (workqueue_pushchunked(taskid, &iovector)) { free(iovector.iov_base); + deflateEnd(&strm); mutex_bucket_unlock(bucket, 0); return; } @@ -274,6 +277,7 @@ static void fullscrape_make_gzip(int taskid, ot_tasktype mode) { /* Parent thread died? */ if (!g_opentracker_running) { + free(iovector.iov_base); deflateEnd(&strm); return; } @@ -402,8 +406,11 @@ static void fullscrape_make_zstd(int taskid, ot_tasktype mode) { mutex_bucket_unlock(bucket, 0); /* Parent thread died? */ - if (!g_opentracker_running) + if (!g_opentracker_running) { + free(iovector.iov_base); + ZSTD_freeCCtx(zstream); return; + } } if ((mode & TASK_TASK_MASK) == TASK_FULLSCRAPE) { -- cgit v1.3