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-devel

Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_update

To: Stephan Creutz <stephan.creutz@xxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 06 Apr 2007 22:42:39 +0100
Delivery-date: Fri, 06 Apr 2007 14:40:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070406154532.38961761.stephan.creutz@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acd4lH9TvdI5YOSHEduLoQAWy6hiGQ==
Thread-topic: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak
User-agent: Microsoft-Entourage/11.3.3.061214
On 6/4/07 14:45, "Stephan Creutz" <stephan.creutz@xxxxxxxxxxxxxxxxx> wrote:

> the following patch adds a missing free to xc_finish_mmu_updates,
> otherwise the memory allocated by xc_init_mmu_updates gets never freed.

The only user of this interface calls free() on that memory itself. It also
calls finish_mmu_update() more than once on the same mmu structure, so
freeing it in finish_mmu_update() would not work. Probably best we rename
xc_init_mmu_updates() to xc_alloc_mmu_updates(), finish_mmu_update to
flush_mmu_updates(), and document the need for explicit free() in the header
file. I'll do this.

 -- Keir



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