projects
/
grub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e61f4eb
)
util/grub-install: rearrange code to avoid memory leak.
author
Andrei Borzenkov
<arvidjaar@gmail.com>
Mon, 26 Jan 2015 19:17:31 +0000
(22:17 +0300)
committer
Andrei Borzenkov
<arvidjaar@gmail.com>
Mon, 26 Jan 2015 20:04:09 +0000
(23:04 +0300)
Found by: Coverity scan.
util/grub-install.c
patch
|
blob
|
history
diff --git
a/util/grub-install.c
b/util/grub-install.c
index
afbc557
..
210f4a7
100644
(file)
--- a/
util/grub-install.c
+++ b/
util/grub-install.c
@@
-615,17
+615,14
@@
device_map_check_duplicates (const char *dev_map)
char **d;
size_t i;
- d = xmalloc (alloced * sizeof (d[0]));
-
if (dev_map[0] == '\0')
return;
fp = grub_util_fopen (dev_map, "r");
if (! fp)
- {
- free (d);
- return;
- }
+ return;
+
+ d = xmalloc (alloced * sizeof (d[0]));
while (fgets (buf, sizeof (buf), fp))
{