From: Vladimir Serbinenko Date: Sun, 25 Jan 2015 00:27:44 +0000 (+0100) Subject: fs/fat: Fix codepath to properly free on error. X-Git-Tag: 2.02-beta3~514 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83543f937a3525ef577c5a6333cb6791aadcee3d;p=thirdparty%2Fgrub.git fs/fat: Fix codepath to properly free on error. Found by: Coverity scan. --- diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c index 79fe864d7..71537ff44 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -1136,7 +1136,7 @@ grub_fat_label (grub_device_t device, char **label) if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY)) { grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); - return 0; + goto fail; } err = grub_fat_iterate_init (&ctxt);