]> git.proxmox.com Git - grub2.git/commit
kern/file: Do not leak device_name on error in grub_file_open()
authorDaniel Axtens <dja@axtens.net>
Thu, 24 Jun 2021 16:19:05 +0000 (02:19 +1000)
committerJulian Andres Klode <julian.klode@canonical.com>
Wed, 8 Jun 2022 10:41:03 +0000 (12:41 +0200)
commitc15fa5fb039cd5062dfa02a03efd924422c4a8ed
tree0009db8d7fb640fe8434256cd97b0b99f7dc4ebc
parent24e6d59ac676791507ff5267bf3bef6cbaff6aef
kern/file: Do not leak device_name on error in grub_file_open()

If we have an error in grub_file_open() before we free device_name, we
will leak it.

Free device_name in the error path and null out the pointer in the good
path once we free it there.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/file.c