Skip to content

Commit

Permalink
linux/getroot: fix memory leak.
Browse files Browse the repository at this point in the history
Found by: Coverity scan.
  • Loading branch information
arvidjaar committed Jan 26, 2015
1 parent 5e27fb0 commit e61f4eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion grub-core/osdep/unix/getroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,10 @@ grub_util_pull_lvm_by_command (const char *os_dev)
free (vgname);

if (!pid)
return;
{
free (vgid);
return;
}

/* Parent. Read vgs' output. */
vgs = fdopen (fd, "r");
Expand Down Expand Up @@ -653,6 +656,7 @@ grub_util_pull_lvm_by_command (const char *os_dev)
close (fd);
waitpid (pid, NULL, 0);
free (buf);
free (vgid);
}

/* ZFS has similar problems to those of btrfs (see above). */
Expand Down

0 comments on commit e61f4eb

Please sign in to comment.