]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/setup: fix memory leak.
authorAndrei Borzenkov <arvidjaar@gmail.com>
Mon, 26 Jan 2015 18:07:19 +0000 (21:07 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Mon, 26 Jan 2015 20:04:09 +0000 (23:04 +0300)
Found by: Coverity scan.

util/setup.c

index 9fb91a82f5dfaaafd470eed671c7e79f87585efd..ed4bd111382ab83c82c4ee875707a80aac96e3bf 100644 (file)
@@ -322,7 +322,10 @@ SETUP (const char *dir,
          continue;
        try_dev = grub_device_open (drive);
        if (! try_dev)
-         continue;
+         {
+           free (drive);
+           continue;
+         }
        if (!found && try_dev->disk->id == dest_dev->disk->id
            && try_dev->disk->dev->id == dest_dev->disk->dev->id)
          {