grub-probe: fix memory leak
Found by: Coverity scan. CID: 73783
This commit is contained in:
parent
fa2af21ec8
commit
d5cc487d39
1 changed files with 7 additions and 0 deletions
|
@ -668,6 +668,13 @@ probe (const char *path, char **device_names, char delim)
|
||||||
for (curdrive = drives_names; *curdrive; curdrive++)
|
for (curdrive = drives_names; *curdrive; curdrive++)
|
||||||
free (*curdrive);
|
free (*curdrive);
|
||||||
free (drives_names);
|
free (drives_names);
|
||||||
|
|
||||||
|
if (path != NULL)
|
||||||
|
{
|
||||||
|
for (curdev = device_names; *curdev; curdev++)
|
||||||
|
free (*curdev);
|
||||||
|
free (device_names);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct argp_option options[] = {
|
static struct argp_option options[] = {
|
||||||
|
|
Loading…
Reference in a new issue