From ab50ae3ef40c81e5bf613905ca3fd636548b75e7 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sun, 23 Oct 2011 17:08:14 +0300 Subject: [PATCH] liblzma: Fix invalid free() in the threaded encoder. It was triggered if initialization failed e.g. due to running out of memory. Thanks to Arkadiusz Miskiewicz. --- src/liblzma/common/outqueue.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/liblzma/common/outqueue.c b/src/liblzma/common/outqueue.c index b9eac16d..d7a87d9a 100644 --- a/src/liblzma/common/outqueue.c +++ b/src/liblzma/common/outqueue.c @@ -101,7 +101,11 @@ extern void lzma_outq_end(lzma_outq *outq, lzma_allocator *allocator) { lzma_free(outq->bufs, allocator); + outq->bufs = NULL; + lzma_free(outq->bufs_mem, allocator); + outq->bufs_mem = NULL; + return; }