diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-23 22:16:25 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-23 22:16:25 +0200 |
| commit | 4ece9d359fd6668bfbc9c4260463f5b5913ae8fc (patch) | |
| tree | 96d9404ca1d46ea9b92db02765a579f0a74f5fd0 /ot_fullscrape.c | |
| parent | 280344488f09ff29deb052dfa94ed74668c00b18 (diff) | |
Avoid returning the result of void functions
Diffstat (limited to 'ot_fullscrape.c')
| -rw-r--r-- | ot_fullscrape.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ot_fullscrape.c b/ot_fullscrape.c index 39f51ec..ec7f2df 100644 --- a/ot_fullscrape.c +++ b/ot_fullscrape.c | |||
| @@ -179,12 +179,15 @@ static void fullscrape_make(int taskid, ot_tasktype mode) { | |||
| 179 | 179 | ||
| 180 | if (mutex_workqueue_pushchunked(taskid, &iovector)) { | 180 | if (mutex_workqueue_pushchunked(taskid, &iovector)) { |
| 181 | free(iovector.iov_base); | 181 | free(iovector.iov_base); |
| 182 | return mutex_bucket_unlock(bucket, 0); | 182 | mutex_bucket_unlock(bucket, 0); |
| 183 | return; | ||
| 183 | } | 184 | } |
| 184 | /* Allocate a fresh output buffer */ | 185 | /* Allocate a fresh output buffer */ |
| 185 | r = iovector.iov_base = malloc(OT_SCRAPE_CHUNK_SIZE); | 186 | r = iovector.iov_base = malloc(OT_SCRAPE_CHUNK_SIZE); |
| 186 | if (!r) | 187 | if (!r) { |
| 187 | return mutex_bucket_unlock(bucket, 0); | 188 | mutex_bucket_unlock(bucket, 0); |
| 189 | return; | ||
| 190 | } | ||
| 188 | 191 | ||
| 189 | /* re points to low watermark */ | 192 | /* re points to low watermark */ |
| 190 | re = r + OT_SCRAPE_CHUNK_SIZE - OT_SCRAPE_MAXENTRYLEN; | 193 | re = r + OT_SCRAPE_CHUNK_SIZE - OT_SCRAPE_MAXENTRYLEN; |
| @@ -256,14 +259,16 @@ static void fullscrape_make_gzip(int taskid, ot_tasktype mode) { | |||
| 256 | 259 | ||
| 257 | if (mutex_workqueue_pushchunked(taskid, &iovector)) { | 260 | if (mutex_workqueue_pushchunked(taskid, &iovector)) { |
| 258 | free(iovector.iov_base); | 261 | free(iovector.iov_base); |
| 259 | return mutex_bucket_unlock(bucket, 0); | 262 | mutex_bucket_unlock(bucket, 0); |
| 263 | return; | ||
| 260 | } | 264 | } |
| 261 | /* Allocate a fresh output buffer */ | 265 | /* Allocate a fresh output buffer */ |
| 262 | iovector.iov_base = malloc(OT_SCRAPE_CHUNK_SIZE); | 266 | iovector.iov_base = malloc(OT_SCRAPE_CHUNK_SIZE); |
| 263 | if (!iovector.iov_base) { | 267 | if (!iovector.iov_base) { |
| 264 | fprintf(stderr, "Out of memory trying to claim ouput buffer\n"); | 268 | fprintf(stderr, "Out of memory trying to claim ouput buffer\n"); |
| 265 | deflateEnd(&strm); | 269 | deflateEnd(&strm); |
| 266 | return mutex_bucket_unlock(bucket, 0); | 270 | mutex_bucket_unlock(bucket, 0); |
| 271 | return; | ||
| 267 | } | 272 | } |
| 268 | strm.next_out = (uint8_t *)iovector.iov_base; | 273 | strm.next_out = (uint8_t *)iovector.iov_base; |
| 269 | strm.avail_out = OT_SCRAPE_CHUNK_SIZE; | 274 | strm.avail_out = OT_SCRAPE_CHUNK_SIZE; |
