Skip to content
  • Ian Campbell's avatar
    xl: do not leak cpupool names. · aede63d9
    Ian Campbell authored
    
    
    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: default avatarIan Campbell <ian.campbell@citrix.com>
    Acked-by: default avatarJuergen <Gross&lt;juergen.gross@ts.fujitsu.com>
    Committed-by: default avatarIan Campbell <ian.campbell@citrix.com>
    aede63d9