minor allocation correction (compressBegin)
authorYann Collet <yann.collet.73@gmail.com>
Sun, 7 Sep 2014 12:29:04 +0000 (13:29 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Sun, 7 Sep 2014 12:29:04 +0000 (13:29 +0100)
lz4frame.c

index eaa8408..91d278b 100644 (file)
@@ -354,6 +354,7 @@ size_t LZ4F_compressBegin(LZ4F_compressionContext_t compressionContext, void* ds
        if (cctxPtr->maxBufferSize < cctxPtr->maxBlockSize)
     {
         cctxPtr->maxBufferSize = cctxPtr->maxBlockSize;
+        FREEMEM(cctxPtr->tmpIn);
         cctxPtr->tmpIn = ALLOCATOR(cctxPtr->maxBlockSize);
         if (cctxPtr->tmpIn == NULL) return -ERROR_allocation_failed;
     }