From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Wolf Subject: [PATCH] libxc: Fix memory leak in zlib usage Date: Tue, 09 Dec 2008 18:42:49 +0100 Message-ID: <493EAE19.8070807@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040207080803090407010207" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040207080803090407010207 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Any call to inflate() must be followed by inflateEnd(), otherwise the internal zlib state is leaked. Signed-off-by: Kevin Wolf --------------040207080803090407010207 Content-Type: text/x-patch; name="libxc-zlib-memleak.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libxc-zlib-memleak.patch" Index: xen-unstable.hg/tools/libxc/xc_dom_core.c =================================================================== --- xen-unstable.hg.orig/tools/libxc/xc_dom_core.c +++ xen-unstable.hg/tools/libxc/xc_dom_core.c @@ -244,6 +244,7 @@ int xc_dom_do_gunzip(void *src, size_t s return -1; } rc = inflate(&zStream, Z_FINISH); + inflateEnd(&zStream); if ( rc != Z_STREAM_END ) { xc_dom_panic(XC_INTERNAL_ERROR, Index: xen-unstable.hg/tools/libxc/xg_private.c =================================================================== --- xen-unstable.hg.orig/tools/libxc/xg_private.c +++ xen-unstable.hg/tools/libxc/xg_private.c @@ -131,6 +131,7 @@ char *xc_inflate_buffer(const char *in_b /* Inflate in one pass/call */ sts = inflate(&zStream, Z_FINISH); + inflateEnd(&zStream); if ( sts != Z_STREAM_END ) { ERROR("inflate failed, sts %d\n", sts); --------------040207080803090407010207 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------040207080803090407010207--