]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fs/fat: Fix codepath to properly free on error.
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 25 Jan 2015 00:27:44 +0000 (01:27 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 25 Jan 2015 00:27:44 +0000 (01:27 +0100)
Found by: Coverity scan.

grub-core/fs/fat.c

index 79fe864d762b4e4d72812a1629a2464d25c3d6bd..71537ff4458b7717dbab564049b396b52e51b809 100644 (file)
@@ -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);