1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Free the zlib stream after expanding a compressed CTF section.

Note that this memory would only be leaked once, since CTF info for a kld
file is cached after the first access.

MFC after:	3 days
This commit is contained in:
Mark Johnston 2015-02-19 03:29:46 +00:00
parent b759b8aa44
commit 250246706f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278983

View File

@ -293,7 +293,9 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc)
zs.next_in = ((uint8_t *) raw) + sizeof(ctf_hdr);
zs.avail_out = sz - sizeof(ctf_hdr);
zs.next_out = ((uint8_t *) ctftab) + sizeof(ctf_hdr);
if ((ret = inflate(&zs, Z_FINISH)) != Z_STREAM_END) {
ret = inflate(&zs, Z_FINISH);
inflateEnd(&zs);
if (ret != Z_STREAM_END) {
printf("%s(%d): zlib inflate returned %d\n", __func__, __LINE__, ret);
error = EIO;
goto out;