diff --git a/ChangeLog b/ChangeLog index 482874788..0d06dee3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-07-20 Colin Watson + + * kern/emu/getroot.c (grub_util_get_grub_dev): Use xasprintf. + 2010-07-20 Colin Watson * disk/loopback.c (grub_cmd_loopback): Don't leak a grub_file_t diff --git a/kern/emu/getroot.c b/kern/emu/getroot.c index 9f89bf657..58dbac9b4 100644 --- a/kern/emu/getroot.c +++ b/kern/emu/getroot.c @@ -695,7 +695,7 @@ grub_util_get_grub_dev (const char *os_dev) if (q) *q = ','; - asprintf (&grub_dev, "md/%s", p); + grub_dev = xasprintf ("md/%s", p); free (p); } else @@ -708,7 +708,7 @@ grub_util_get_grub_dev (const char *os_dev) if (mdadm_name) { free (grub_dev); - asprintf (&grub_dev, "md/%s", mdadm_name); + grub_dev = xasprintf ("md/%s", mdadm_name); free (mdadm_name); } }