remove possible mem leak in error cases by brotli compression too

This commit is contained in:
sebres
2023-09-27 15:10:39 +02:00
parent 396505c7d7
commit fa7e6314cb

View File

@@ -480,6 +480,15 @@ size_t BROTLIMT_compressCCtx(BROTLIMT_CCtx * ctx, BROTLIMT_RdWr_t * rdwr)
retval_of_thread = p;
}
/* move remaining done/busy entries to free list */
while (!list_empty(&ctx->writelist_done)) {
struct list_head *entry = list_first(&ctx->writelist_done);
list_move(entry, &ctx->writelist_free);
}
while (!list_empty(&ctx->writelist_busy)) {
struct list_head* entry = list_first(&ctx->writelist_busy);
list_move(entry, &ctx->writelist_free);
}
/* clean up lists */
while (!list_empty(&ctx->writelist_free)) {
struct writelist *wl;