diff --git a/ChangeLog b/ChangeLog index 52da3c3a6..07f3fb62c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-11-28 Colin Watson + + * util/getroot.c (find_root_device_from_libzfs): Use xasprintf. + 2011-11-27 Vladimir Serbinenko * grub-core/fs/zfs/zfs.c (recovery): Fix spelling. diff --git a/util/getroot.c b/util/getroot.c index cc3fdf77d..05bee4964 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -355,7 +355,7 @@ find_root_device_from_libzfs (const char *dir) char name[PATH_MAX], state[256], readlen[256], writelen[256], cksum[256], notes[256]; unsigned int dummy; - asprintf (&cmd, "zpool status %s", poolname); + cmd = xasprintf ("zpool status %s", poolname); fp = popen (cmd, "r"); free (cmd); @@ -392,7 +392,7 @@ find_root_device_from_libzfs (const char *dir) free (line); } - asprintf (&device, "/dev/%s", name); + device = xasprintf ("/dev/%s", name); fail: pclose (fp);