]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fs/cbfs: Add missing free.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 23:00:49 +0000 (00:00 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 23:00:49 +0000 (00:00 +0100)
Found by: Coverity scan.

grub-core/fs/cbfs.c

index 35750a0e4d9257cf4c65a6057718c0cf79a7618a..4ddd6832fa8a750e66c512efa4583c71c79faa1b 100644 (file)
@@ -144,7 +144,7 @@ static struct grub_archelp_data *
 grub_cbfs_mount (grub_disk_t disk)
 {
   struct cbfs_file hd;
-  struct grub_archelp_data *data;
+  struct grub_archelp_data *data = NULL;
   grub_uint32_t ptr;
   grub_off_t header_off;
   struct cbfs_header head;
@@ -196,6 +196,7 @@ grub_cbfs_mount (grub_disk_t disk)
   return data;
 
 fail:
+  grub_free (data);
   grub_error (GRUB_ERR_BAD_FS, "not a cbfs filesystem");
   return 0;
 }