]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/getroot: Add missing grub_disk_close.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:54:14 +0000 (09:54 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:54:14 +0000 (09:54 +0100)
Found by: Coverity scan.

util/getroot.c

index 3958105d8192b598658e03420883597deee418ab..345d49ba83827cc7e439dd682d58b5b2da5b0543 100644 (file)
@@ -417,7 +417,10 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
 
     name = grub_util_get_ldm (disk, ctx.start);
     if (name)
-      return name;
+      {
+       grub_disk_close (disk);
+       return name;
+      }
 
     ctx.partname = NULL;