[PATCH] lib/zlib: define rc

From: Elijah Conners
Date: Tue Oct 04 2022 - 02:00:43 EST


The __gunzip() and zlib_inflate_blob() functions refer to the
zlib_inflateEnd() function, although this function has no side effects.
In the former's case, it's likely that rc (the result of the function)
was meant to be set to the the result of zlib_inflateEnd(), while
zlib_inflate_blob() has no use for this function in rc.

Signed-off-by: Elijah Conners <business@xxxxxxxxxxxxxx>
---
lib/decompress_inflate.c | 2 +-
lib/zlib_inflate/infutil.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index 6130c42b8e59..df03d1919925 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -177,7 +177,7 @@ STATIC int INIT __gunzip(unsigned char *buf, long len,
}
}

- zlib_inflateEnd(strm);
+ rc = zlib_inflateEnd(strm);
if (pos)
/* add + 8 to skip over trailer */
*pos = strm->next_in - zbuf+8;
diff --git a/lib/zlib_inflate/infutil.c b/lib/zlib_inflate/infutil.c
index 4824c2cc7a09..588839fff01d 100644
--- a/lib/zlib_inflate/infutil.c
+++ b/lib/zlib_inflate/infutil.c
@@ -37,7 +37,6 @@ int zlib_inflate_blob(void *gunzip_buf, unsigned int sz,
rc = sz - strm->avail_out;
else
rc = -EINVAL;
- zlib_inflateEnd(strm);
} else
rc = -EINVAL;

--
2.29.2.windows.2