diff --git a/util/grub-probe.c b/util/grub-probe.c index ecb7b6bbd..8a0c4f35b 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -295,6 +295,7 @@ probe (const char *path, char **device_names, char delim) } printf ("%s", disk); putchar (delim); + free (disk); } return; } @@ -496,6 +497,7 @@ probe (const char *path, char **device_names, char delim) { grub_util_fprint_full_disk_name (stdout, dev->disk->name, dev); putchar (delim); + grub_device_close (dev); continue; } @@ -542,7 +544,7 @@ probe (const char *path, char **device_names, char delim) if (print == PRINT_IEEE1275_HINT) { const char *osdev = grub_util_biosdisk_get_osdev (dev->disk); - const char *ofpath = grub_util_devname_to_ofpath (osdev); + char *ofpath = grub_util_devname_to_ofpath (osdev); const char *map; map = grub_util_biosdisk_get_compatibility_hint (dev->disk); @@ -560,6 +562,7 @@ probe (const char *path, char **device_names, char delim) strcpy (p, ofpath); grub_util_fprint_full_disk_name (stdout, tmp, dev); free (tmp); + free (ofpath); putchar (delim); }