util/setup: fix memory leak.

Found by: Coverity scan.
This commit is contained in:
Andrei Borzenkov 2015-01-26 21:07:19 +03:00
parent e2a21238da
commit 64440daa21
1 changed files with 4 additions and 1 deletions

View 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)
{