From: Ian Campbell Subject: Re: [PATCH] xl: do not leak cpupool names Date: Fri, 14 Sep 2012 10:06:40 +0100 Message-ID: <1347613600.24226.170.camel@zakaz.uk.xensource.com> References: <5048A869.6060002@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5048A869.6060002@ts.fujitsu.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: Juergen Gross Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2012-09-06 at 14:43 +0100, Juergen Gross wrote: > Am 06.09.2012 13:46, schrieb Ian Campbell: > > # HG changeset patch > > # User Ian Campbell > > # Date 1346931944 -3600 > > # Node ID d4d7031eb68bf0ce9bc83901b699cf13a2c73c95 > > # Parent 1db796c3c0b97bba222f20db543c227e313ec1be > > xl: do not leak cpupool names. > > > > Valgrind reports: > > ==3076== 7 bytes in 1 blocks are definitely lost in loss record 1 of 1 > > ==3076== at 0x402458C: malloc (vg_replace_malloc.c:270) > > ==3076== by 0x406F86D: libxl_cpupoolid_to_name (libxl_utils.c:102) > > ==3076== by 0x8058742: parse_config_data (xl_cmdimpl.c:639) > > ==3076== by 0x805BD56: create_domain (xl_cmdimpl.c:1838) > > ==3076== by 0x805DAED: main_create (xl_cmdimpl.c:3903) > > ==3076== by 0x804D39D: main (xl.c:285) > > > > And indeed there are several places where xl uses > > libxl_cpupoolid_to_name as a boolean to test if the pool name is > > valid and leaks the name if it is. Introduce an is_valid helper and > > use that instead. > > > > Signed-off-by: Ian Campbell > > Acked-by: Juergen Gross Applied, thanks.