1
0
mirror of https://git.tukaani.org/xz.git synced 2025-12-11 16:08:45 +00:00

liblzma: Refactor a loop in lzma_filters_copy()

Arguably it's nicer if i doesn't wrap around when the loop terminates.

Fixes: Coverity CID 464589
Fixes: 6d118a0b9def ("Add lzma_filters_copy().")
This commit is contained in:
Lasse Collin 2025-11-02 12:57:00 +02:00
parent 90b67853d5
commit 6cc2da0a4b
No known key found for this signature in database
GPG Key ID: 38EE757D69184620

View File

@ -213,8 +213,8 @@ lzma_filters_copy(const lzma_filter *src, lzma_filter *real_dest,
error:
// Free the options which we have already allocated.
while (i-- > 0)
lzma_free(dest[i].options, allocator);
while (i > 0)
lzma_free(dest[--i].options, allocator);
return ret;
}