projects
/
grub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa2af21
)
grub-probe: fix memory leak
author
Andrei Borzenkov
<arvidjaar@gmail.com>
Sat, 9 Jan 2016 10:49:37 +0000
(13:49 +0300)
committer
Andrei Borzenkov
<arvidjaar@gmail.com>
Sat, 9 Jan 2016 10:55:28 +0000
(13:55 +0300)
Found by: Coverity scan.
CID: 73783
util/grub-probe.c
patch
|
blob
|
history
diff --git
a/util/grub-probe.c
b/util/grub-probe.c
index
b1f5336
..
36b7f8b
100644
(file)
--- a/
util/grub-probe.c
+++ b/
util/grub-probe.c
@@
-668,6
+668,13
@@
probe (const char *path, char **device_names, char delim)
for (curdrive = drives_names; *curdrive; curdrive++)
free (*curdrive);
free (drives_names);
+
+ if (path != NULL)
+ {
+ for (curdev = device_names; *curdev; curdev++)
+ free (*curdev);
+ free (device_names);
+ }
}
static struct argp_option options[] = {