From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() Date: Fri, 21 Jun 2013 18:30:25 +0100 Message-ID: <51C48DB1.2030800@citrix.com> References: <20932.36093.15692.139649@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20932.36093.15692.139649@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: George Dunlap , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 21/06/13 18:27, Ian Jackson wrote: > Andrew Cooper writes ("[PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()"): >> tools/libxc: Fix memory leaks in xc_domain_restore() >> + free(region_mfn); > ... >> + pagebuf_free(&pagebuf); > These look correct to me. > > But as regards > >> + free(ctx->p2m_batch); > It's not clear to me where that's initialised. It needs to be > initialised to NULL I think. > > Ian. It is initialised in memset(ctx, 0, sizeof(*ctx)) at the top of the function. ~Andrew