aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jeremy.kerr@canonical.com>2012-08-23 21:33:53 +0800
committerJeremy Kerr <jeremy.kerr@canonical.com>2012-08-24 20:03:56 +0800
commitb4773c902aeff4e09c652f90cd93875bc9d66132 (patch)
tree81bb4e3bbec9e6a42f6244e42af9c430065166e2
parent41c741fe13967c74604e21087f3d55d344f409f2 (diff)
downloadsbsigntools-b4773c902aeff4e09c652f90cd93875bc9d66132.tar.gz
sbkeysync: fix invalid free in keystore_read_entry
We want to free path, not ke. We can also unify the error path. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
-rw-r--r--src/sbkeysync.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/sbkeysync.c b/src/sbkeysync.c
index 5fa4479..22852a4 100644
--- a/src/sbkeysync.c
+++ b/src/sbkeysync.c
@@ -544,17 +544,15 @@ static int check_efivars_mount(const char *mountpoint)
static int keystore_entry_read(struct fs_keystore_entry *ke)
{
const char *path;
+ int rc;
path = talloc_asprintf(ke, "%s/%s", ke->root, ke->name);
- if (fileio_read_file(ke, path, &ke->data, &ke->len)) {
- talloc_free(ke);
- return -1;
- }
+ rc = fileio_read_file(ke, path, &ke->data, &ke->len);
talloc_free(path);
- return 0;
+ return rc;
}
static bool keystore_contains_file(struct fs_keystore *keystore,