From 10f5d37fd38d6c87a4273e3aa4957fbf90a28a75 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 26 Feb 2013 22:45:00 +0100 Subject: [PATCH 159/364] * grub-core/disk/efi/efidisk.c(grub_efidisk_get_device_name): Fix memory leak if device name is not found. --- ChangeLog | 5 +++++ grub-core/disk/efi/efidisk.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1b66689..d770758 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-02-26 Andrey Borzenkov + + * grub-core/disk/efi/efidisk.c(grub_efidisk_get_device_name): Fix + memory leak if device name is not found. + 2013-02-25 Andrey Borzenkov * grub-core/normal/menu_entry.c (update_screen): remove diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index 98cd226..19c5923 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -797,7 +797,10 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) dup_ldp->length[1] = 0; if (!get_diskname_from_path (dup_dp, device_name)) - return 0; + { + grub_free (dup_dp); + return 0; + } parent = grub_disk_open (device_name); grub_free (dup_dp); -- 1.8.1.4