You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

42 lines
1.1 KiB

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