Commit f826d914 authored by Andrei Borzenkov's avatar Andrei Borzenkov

grub-probe: fix memory leak

Found by: Coverity scan.
CID: 73783
parent 77002c65
......@@ -279,7 +279,7 @@ probe (const char *path, char **device_names, char delim)
printf ("%s", *curdev);
putchar (delim);
}
return;
goto free_device_names;
}
if (print == PRINT_DISK)
......@@ -297,7 +297,7 @@ probe (const char *path, char **device_names, char delim)
putchar (delim);
free (disk);
}
return;
goto free_device_names;
}
for (curdev = device_names; *curdev; curdev++)
......@@ -669,6 +669,7 @@ probe (const char *path, char **device_names, char delim)
free (*curdrive);
free (drives_names);
free_device_names:
if (path != NULL)
{
for (curdev = device_names; *curdev; curdev++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment