From 9420d7d950036c3fde037dd4071f2a5bb6daba04 Mon Sep 17 00:00:00 2001 From: Vitalii Sheludchenkov Date: Thu, 27 Mar 2025 15:11:30 +0100 Subject: [PATCH] removed redundant free call --- C/XzIn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/C/XzIn.c b/C/XzIn.c index d73b1f7..46eb2fc 100644 --- a/C/XzIn.c +++ b/C/XzIn.c @@ -117,10 +117,8 @@ static SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAllocPt p->numBlocks = numBlocks; p->blocks = (CXzBlockSizes *)ISzAlloc_Alloc(alloc, sizeof(CXzBlockSizes) * numBlocks); if (!p->blocks) - { - Xz_Free(p, alloc); return SZ_ERROR_MEM; - } + for (i = 0; i < numBlocks; i++) { CXzBlockSizes *block = &p->blocks[i]; @@ -147,7 +145,7 @@ static SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAllocPt Xz_Free(p, alloc); return SZ_ERROR_ARCHIVE; } - + return SZ_OK; }