From: Vladimir 'phcoder' Serbinenko Date: Sat, 12 Nov 2011 22:42:49 +0000 (+0100) Subject: * grub-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak. X-Git-Tag: 2.00~944 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91ee7b6d737fdba31e052fbe44349d94895df99f;p=thirdparty%2Fgrub.git * grub-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak. --- 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"));