b_info is a user provided struct and therefore the content must come from
malloc and not gc such that libxl_domain_build_info_dispose can free it. This
was broken by 25340:
373f24c87dee.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
if ( lstat(bootloader, &st) )
LOG(DEBUG, "%s doesn't exist, falling back to config path",
bootloader);
- else
- info->u.pv.bootloader = bootloader;
+ else {
+ free(info->u.pv.bootloader);
+ info->u.pv.bootloader = libxl__strdup(NULL, bootloader);
+ }
}
make_bootloader_args(gc, bl);