grub-probe: fix memory leak
Found by: Coverity scan. CID: 73783
This commit is contained in:
parent
77002c65d3
commit
f826d914e2
1 changed files with 3 additions and 2 deletions
|
@ -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++)
|
||||
|
|
Loading…
Reference in a new issue