aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/outqueue.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-10-23 17:08:14 +0300
committerLasse Collin <lasse.collin@tukaani.org>2011-10-23 17:08:14 +0300
commitab50ae3ef40c81e5bf613905ca3fd636548b75e7 (patch)
tree38a775f6ffb885a85f6ab34ad1480eba3ca44275 /src/liblzma/common/outqueue.c
parentliblzma: Fix a deadlock in the threaded encoder. (diff)
downloadxz-ab50ae3ef40c81e5bf613905ca3fd636548b75e7.tar.xz
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.
Diffstat (limited to 'src/liblzma/common/outqueue.c')
-rw-r--r--src/liblzma/common/outqueue.c4
1 files changed, 4 insertions, 0 deletions
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;
}