Blame SOURCES/0007-efi_generate_file_device_path-fix-one-error-case-s-f.patch
|
|
ac385c |
From 1461dc3b17aa54377bbc461bf7d5a809322dae17 Mon Sep 17 00:00:00 2001
|
|
|
ac385c |
From: Peter Jones <pjones@redhat.com>
|
|
|
ac385c |
Date: Mon, 1 May 2017 14:46:37 -0400
|
|
|
ac385c |
Subject: [PATCH 07/22] efi_generate_file_device_path(): fix one error case's
|
|
|
ac385c |
free path.
|
|
|
ac385c |
|
|
|
ac385c |
When efi_generate_file_device_path() gets an error from
|
|
|
ac385c |
find_parent_devpath(), it currently just returns an error, rather than
|
|
|
ac385c |
freeing up its intermediate resources. So free them.
|
|
|
ac385c |
|
|
|
ac385c |
Found by covscan.
|
|
|
ac385c |
|
|
|
ac385c |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
ac385c |
---
|
|
|
ac385c |
src/creator.c | 4 ++--
|
|
|
ac385c |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
ac385c |
|
|
|
ac385c |
diff --git a/src/creator.c b/src/creator.c
|
|
|
ac385c |
index ca01964..6d662b7 100644
|
|
|
ac385c |
--- a/src/creator.c
|
|
|
ac385c |
+++ b/src/creator.c
|
|
|
ac385c |
@@ -345,7 +345,7 @@ efi_generate_file_device_path(uint8_t *buf, ssize_t size,
|
|
|
ac385c |
rc = find_parent_devpath(child_devpath, &parent_devpath);
|
|
|
ac385c |
if (rc < 0) {
|
|
|
ac385c |
efi_error("could not find parent device for file");
|
|
|
ac385c |
- return -1;
|
|
|
ac385c |
+ goto err;
|
|
|
ac385c |
}
|
|
|
ac385c |
|
|
|
ac385c |
rc = get_partition_number(child_devpath);
|
|
|
ac385c |
@@ -369,7 +369,7 @@ err:
|
|
|
ac385c |
if (child_devpath)
|
|
|
ac385c |
free(child_devpath);
|
|
|
ac385c |
if (parent_devpath)
|
|
|
ac385c |
- free(parent_devpath);
|
|
|
ac385c |
+ free(parent_devpath);
|
|
|
ac385c |
if (relpath)
|
|
|
ac385c |
free(relpath);
|
|
|
ac385c |
errno = saved_errno;
|
|
|
ac385c |
--
|
|
|
ac385c |
2.12.2
|
|
|
ac385c |
|