diff --git a/lib/decompress_unxz.c b/lib/decompress_unxz.c index 05d5cb490a44..9ccded9934c6 100644 --- a/lib/decompress_unxz.c +++ b/lib/decompress_unxz.c @@ -342,14 +342,14 @@ STATIC int INIT unxz(unsigned char *in, long in_size, b.out_pos = 0; } } while (ret == XZ_OK); - - if (must_free_in) - free(in); - - if (flush != NULL) - free(b.out); } + if (must_free_in) + free(in); + + if (flush != NULL) + free(b.out); + if (in_used != NULL) *in_used += b.in_pos;