diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-06 19:25:45 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-06 19:25:45 +0100 |
| commit | b6838536fcd0f4361d3907e95f3247b1f1281a62 (patch) | |
| tree | 4b05f24eef2d467d0582941935de6f5355724dba /src | |
| parent | 4a01fea4a96374a1359d43a280a236a3ea042a1c (diff) | |
To silence leak checkers, properly deinit fullscrape writers when zlib is used, in case opentracker stops mid-creation
Diffstat (limited to 'src')
| -rw-r--r-- | src/ot_fullscrape.c | 11 |
1 files changed, 9 insertions, 2 deletions
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) { | |||
| 188 | mutex_bucket_unlock(bucket, 0); | 188 | mutex_bucket_unlock(bucket, 0); |
| 189 | 189 | ||
| 190 | /* Parent thread died? */ | 190 | /* Parent thread died? */ |
| 191 | if (!g_opentracker_running) | 191 | if (!g_opentracker_running) { |
| 192 | free(iovector.iov_base); | ||
| 192 | return; | 193 | return; |
| 194 | } | ||
| 193 | } | 195 | } |
| 194 | 196 | ||
| 195 | if ((mode & TASK_TASK_MASK) == TASK_FULLSCRAPE) | 197 | if ((mode & TASK_TASK_MASK) == TASK_FULLSCRAPE) |
| @@ -250,6 +252,7 @@ static void fullscrape_make_gzip(int taskid, ot_tasktype mode) { | |||
| 250 | 252 | ||
| 251 | if (workqueue_pushchunked(taskid, &iovector)) { | 253 | if (workqueue_pushchunked(taskid, &iovector)) { |
| 252 | free(iovector.iov_base); | 254 | free(iovector.iov_base); |
| 255 | deflateEnd(&strm); | ||
| 253 | mutex_bucket_unlock(bucket, 0); | 256 | mutex_bucket_unlock(bucket, 0); |
| 254 | return; | 257 | return; |
| 255 | } | 258 | } |
| @@ -274,6 +277,7 @@ static void fullscrape_make_gzip(int taskid, ot_tasktype mode) { | |||
| 274 | 277 | ||
| 275 | /* Parent thread died? */ | 278 | /* Parent thread died? */ |
| 276 | if (!g_opentracker_running) { | 279 | if (!g_opentracker_running) { |
| 280 | free(iovector.iov_base); | ||
| 277 | deflateEnd(&strm); | 281 | deflateEnd(&strm); |
| 278 | return; | 282 | return; |
| 279 | } | 283 | } |
| @@ -402,8 +406,11 @@ static void fullscrape_make_zstd(int taskid, ot_tasktype mode) { | |||
| 402 | mutex_bucket_unlock(bucket, 0); | 406 | mutex_bucket_unlock(bucket, 0); |
| 403 | 407 | ||
| 404 | /* Parent thread died? */ | 408 | /* Parent thread died? */ |
| 405 | if (!g_opentracker_running) | 409 | if (!g_opentracker_running) { |
| 410 | free(iovector.iov_base); | ||
| 411 | ZSTD_freeCCtx(zstream); | ||
| 406 | return; | 412 | return; |
| 413 | } | ||
| 407 | } | 414 | } |
| 408 | 415 | ||
| 409 | if ((mode & TASK_TASK_MASK) == TASK_FULLSCRAPE) { | 416 | if ((mode & TASK_TASK_MASK) == TASK_FULLSCRAPE) { |
