Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
grub2.26833
0010-kern-file-Do-not-leak-device_name-on-error...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0010-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch of Package grub2.26833
From 2944947e880d423090498b01632304d9aa58c488 Mon Sep 17 00:00:00 2001 From: Daniel Axtens <dja@axtens.net> Date: Fri, 25 Jun 2021 02:19:05 +1000 Subject: [PATCH 10/33] 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/kern/file.c b/grub-core/kern/file.c index 668f8930b1..74fcbe4d65 100644 --- a/grub-core/kern/file.c +++ b/grub-core/kern/file.c @@ -80,6 +80,7 @@ grub_file_open (const char *name) device = grub_device_open (device_name); grub_free (device_name); + device_name = NULL; if (! device) goto fail; @@ -130,6 +131,7 @@ grub_file_open (const char *name) return file; fail: + grub_free (device_name); if (device) grub_device_close (device); -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor