From 91ee7b6d737fdba31e052fbe44349d94895df99f Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 12 Nov 2011 23:42:49 +0100 Subject: [PATCH] * grub-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak. --- ChangeLog | 4 ++++ grub-core/kern/emu/hostdisk.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9f5b71fe4..1ce25663d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-11-12 Vladimir Serbinenko + + * grub-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak. + 2011-11-12 Vladimir Serbinenko * include/grub/lvm.h (grub_lvm_pv): Correct start type. diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index f537b2759..ede765d83 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -1751,7 +1751,10 @@ find_system_device (const char *os_dev, struct stat *st, int convert, int add) } if (!add) - return -1; + { + free (os_disk); + return -1; + } if (i == ARRAY_SIZE (map)) grub_util_error (_("device count exceeds limit"));