* kern/emu/getroot.c (grub_util_get_grub_dev): Use xasprintf.

This commit is contained in:
Colin Watson 2010-07-20 23:09:45 +01:00
parent efc9d7f175
commit b26f1c1160
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2010-07-20 Colin Watson <cjwatson@ubuntu.com>
* kern/emu/getroot.c (grub_util_get_grub_dev): Use xasprintf.
2010-07-20 Colin Watson <cjwatson@ubuntu.com> 2010-07-20 Colin Watson <cjwatson@ubuntu.com>
* disk/loopback.c (grub_cmd_loopback): Don't leak a grub_file_t * disk/loopback.c (grub_cmd_loopback): Don't leak a grub_file_t

View file

@ -695,7 +695,7 @@ grub_util_get_grub_dev (const char *os_dev)
if (q) if (q)
*q = ','; *q = ',';
asprintf (&grub_dev, "md/%s", p); grub_dev = xasprintf ("md/%s", p);
free (p); free (p);
} }
else else
@ -708,7 +708,7 @@ grub_util_get_grub_dev (const char *os_dev)
if (mdadm_name) if (mdadm_name)
{ {
free (grub_dev); free (grub_dev);
asprintf (&grub_dev, "md/%s", mdadm_name); grub_dev = xasprintf ("md/%s", mdadm_name);
free (mdadm_name); free (mdadm_name);
} }
} }