From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 03:29:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0883E8F; Thu, 19 Feb 2015 03:29:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C264FAC; Thu, 19 Feb 2015 03:29:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J3Tlo0087570; Thu, 19 Feb 2015 03:29:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J3TlnJ087569; Thu, 19 Feb 2015 03:29:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502190329.t1J3TlnJ087569@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 19 Feb 2015 03:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278983 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2015 03:29:47 -0000 Author: markj Date: Thu Feb 19 03:29:46 2015 New Revision: 278983 URL: https://svnweb.freebsd.org/changeset/base/278983 Log: 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 Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Thu Feb 19 02:56:34 2015 (r278982) +++ head/sys/kern/kern_ctf.c Thu Feb 19 03:29:46 2015 (r278983) @@ -293,7 +293,9 @@ link_elf_ctf_get(linker_file_t lf, linke 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;