WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.2-testing] libxc: Fix memory leak in zlib usage

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.2-testing] libxc: Fix memory leak in zlib usage
From: "Xen patchbot-3.2-testing" <patchbot-3.2-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 Dec 2008 14:00:35 -0800
Delivery-date: Thu, 11 Dec 2008 14:00:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1228919738 0
# Node ID 51f26d6ebc6c0f581208701e8da629c0a112b21d
# Parent  68bbfdfbda3ae7da6b0415adfbef1499bd9636a5
libxc: Fix memory leak in zlib usage

Any call to inflate() must be followed by inflateEnd(), otherwise the
internal zlib state is leaked.

Signed-off-by: Kevin Wolf <kwolf@xxxxxxx>
xen-unstable changeset:   18892:b73f3646a17fa5fb9fa8edd0a5a4d70dd3353c15
xen-unstable date:        Wed Dec 10 13:14:13 2008 +0000
---
 tools/libxc/xc_dom_core.c |    1 +
 tools/libxc/xg_private.c  |    1 +
 2 files changed, 2 insertions(+)

diff -r 68bbfdfbda3a -r 51f26d6ebc6c tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c Wed Dec 10 14:34:25 2008 +0000
+++ b/tools/libxc/xc_dom_core.c Wed Dec 10 14:35:38 2008 +0000
@@ -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,
diff -r 68bbfdfbda3a -r 51f26d6ebc6c tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c  Wed Dec 10 14:34:25 2008 +0000
+++ b/tools/libxc/xg_private.c  Wed Dec 10 14:35:38 2008 +0000
@@ -147,6 +147,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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.2-testing] libxc: Fix memory leak in zlib usage, Xen patchbot-3.2-testing <=