summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabríel Arthúr Pétursson <gabriel.petursson@marel.com>2024-01-03 17:20:04 +0100
committerGabríel Arthúr Pétursson <gabriel.petursson@marel.com>2024-02-01 13:20:00 +0100
commit4a67075007cceb28586d878919649dce08ba226b (patch)
tree9701717b096ff549ad3abc7f426012674c7fbd6b
parentshared: Move cryptsetup-tpm2.[ch] from systemd-cryptsetup (diff)
downloadsystemd-4a67075007cceb28586d878919649dce08ba226b.tar.xz
systemd-4a67075007cceb28586d878919649dce08ba226b.zip
cryptsetup: Fix memory leak when iterating over systemd-tpm2 tokens
-rw-r--r--src/cryptsetup/cryptsetup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 0840a71548..1a02730037 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -1724,7 +1724,6 @@ static int attach_luks_or_plain_or_bitlk_by_tpm2(
}
if (r == -EOPNOTSUPP) { /* Plugin not available, let's process TPM2 stuff right here instead */
- _cleanup_(iovec_done) struct iovec blob = {}, policy_hash = {};
bool found_some = false;
int token = 0; /* first token to look at */
@@ -1734,6 +1733,7 @@ static int attach_luks_or_plain_or_bitlk_by_tpm2(
for (;;) {
_cleanup_(iovec_done) struct iovec pubkey = {}, salt = {}, srk = {}, pcrlock_nv = {};
+ _cleanup_(iovec_done) struct iovec blob = {}, policy_hash = {};
uint32_t hash_pcr_mask, pubkey_pcr_mask;
uint16_t pcr_bank, primary_alg;
TPM2Flags tpm2_flags;