diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2011-10-23 17:08:14 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2011-10-23 17:08:14 +0300 |
commit | ab50ae3ef40c81e5bf613905ca3fd636548b75e7 (patch) | |
tree | 38a775f6ffb885a85f6ab34ad1480eba3ca44275 /src/liblzma | |
parent | liblzma: Fix a deadlock in the threaded encoder. (diff) | |
download | xz-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')
-rw-r--r-- | src/liblzma/common/outqueue.c | 4 |
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; } |